User Profile from a Package

Discussions related to custom development with Select.
Post Reply
dflood2
Posts: 12
Joined: Thu Mar 11, 2010 12:11 pm

User Profile from a Package

Post by dflood2 »

How can I find all of items in the "user / profile" for the current user from a package? IE \\Default\etc..

For example when my package is run I would like to know for the current user all of the items in their "SPAdmin" "User/Group" "user Name" "Profiles" tab. Then I can configure some defaults in the package for them.

Thanks

David
John Morris
Posts: 411
Joined: Thu Sep 11, 2008 11:35 am
Location: Raleigh, NC, USA
Contact:

Re: User Profile from a Package

Post by John Morris »

The current API does not expose that data. You will need to query the SQL table(s) directly until the public API supports this ability. This is a planned feature of the Boylan release (later this year).
John Morris
Sr. Software Architect
SoftPro
dflood2
Posts: 12
Joined: Thu Mar 11, 2010 12:11 pm

Re: User Profile from a Package

Post by dflood2 »

This is what we ended up with:

WITH ProfileTree(Parent, ID, ProfileName) AS
(
SELECT Parent, ID, cast('\\'+[Name] as varchar(255)) AS ProfileName
FROM dbo.Profile
WHERE Parent IS NULL
UNION ALL
SELECT e.Parent, e.ID, cast(d.ProfileName + '\' + e.[Name] as varchar(255))
FROM dbo.Profile e
INNER JOIN ProfileTree d
ON e.Parent = d.ID
)
SELECT p.id, p.name, d.ProfileName
FROM ProfileTree d
INNER JOIN dbo.profile p
ON d.id = p.id
WHERE LEN(p.profitcenter)>0
ORDER BY ProfileName
Post Reply