Repository.Project.GetUserPermissions: Difference between revisions
Jump to navigation
Jump to search
(Created page with '{{Template:API}}{{Template:APIBreadcrumb|.Repository}} <onlyinclude>Returns an array of '''UserPermissionsEnum''' of all permission…') |
No edit summary |
||
(2 intermediate revisions by the same user not shown) | |||
Line 2: | Line 2: | ||
<onlyinclude>Returns an array of '''[[ | <onlyinclude>Returns an array of '''[[UserPermissionEnum|UserPermissionEnum]]''' of all permissions the user has for the specified project. Connected user must have Admin permissions to obtain the list of permissions for another user. Admin permissions are not required to a list of permissions for your own account.</onlyinclude> | ||
== Syntax == | == Syntax == | ||
Line 25: | Line 25: | ||
{{APIPrefix|Dim}} iProjectID {{APIPrefix|As}} Integer | {{APIPrefix|Dim}} iProjectID {{APIPrefix|As}} Integer | ||
sUserLogin = "myDomain\TestUser" | sUserLogin = "myDomain\TestUser" | ||
iProjectID = | {{APIComment|'Get project ID for first project in the list}} | ||
iProjectID = MyRepository.Project.GetAllProjects(0).ID | |||
ListofPermissions= MyRepository.Project.GetUserAccessibleProjects(sUserLogin, iProjectID) | ListofPermissions= MyRepository.Project.GetUserAccessibleProjects(sUserLogin, iProjectID) |
Latest revision as of 19:12, 9 August 2018
Member of: SynthesisAPI.Repository
Returns an array of UserPermissionEnum of all permissions the user has for the specified project. Connected user must have Admin permissions to obtain the list of permissions for another user. Admin permissions are not required to a list of permissions for your own account.
Syntax
.Project.GetUserPermissions(UserLogin, ProjectID)
Parameters
UserLogin
- Required. String. The user login (domain\user). If the input is empty then the method returns the projects for the currently connected user.
ProjectID
- Required. Integer. The project ID for which permissions are to be checked.
Example
VBA|VB.NET 'Declare a new Repository object and connect to a ReliaSoft repository. Dim MyRepository As New Repository MyRepository.ConnectToAccessRepository("C:\RSRepository1.rsr18") 'Get permissions in the repository for a specified user for a specific project. Dim ListofPermissions() As UserPermissionsEnum Dim sUserLogin As String Dim iProjectID As Integer sUserLogin = "myDomain\TestUser" 'Get project ID for first project in the list iProjectID = MyRepository.Project.GetAllProjects(0).ID ListofPermissions= MyRepository.Project.GetUserAccessibleProjects(sUserLogin, iProjectID)