Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
This routine is available starting with SIL Engine™ 1.0.
Info
titleAvailability
Table plus
applyColStyleToCelltrue
heading0
columnTypess,s,s,s
multiplefalse
columnAttributesstyle="background:#e5e7ea;font-weight:bold,,style="background:#e5e7ea;font-weight:bold,
enableSortingfalse

Syntax

projectsForUser(user, roles)

Package

Alias

Pkg Usage

Description

Excerpt
hiddentrue
Returns all the projects where this user has permission to assign or to be assigned issues.

Returns all the projects where this user has permission to assign or to be assigned issues.

Parameters

Table plus
applyColStyleToCelltrue
columnTypess,s,s,s
heading0
multiplefalse
enableSortingfalse

Parameter name

Type

Required

Description

user

String

Yes

Username or userkey of the user that is verified.

roles

...

String []

No

Roles the user must have.

Return

...

Type

string String []

Returns a list of project keys where keys where the user denoted by the specified username or userkey has permission to assign or to be assigned issues. If the second parameter is available, it returns a list of project keys where the user is available in one of the specified roles.

...

Examples

Example 1

Code Block
//user "Admin" has permission to assign issues or has the permission to be assigned in the following projects: PRJ1, PRJ2, PRJ8.
print("You are allowed to work on the following projects: ");
print(projectsForUser("Admin"));

Results: The following string is returned: You are allowed to work on the following projects: PRJ1, PRJ2, PRJ8.  Check the values on the next row beginning with <StringPrintRoutine>.

Example 2

Code Block
projectsForUser(currentUser());

Results: Returns an array containing the keys of all the projects where the user has permission to assign issues or has the permission issues to be assigned.

...

Code Block
return projectsForUser("admin", {"Administrators", "Developers"} );

Results: Returns an array containing the keys of all the projects where the user is in role of Administrator or Developer.Notes:

Note

  1. The look -up is first made after the userkey, then after the username.
  2. If there are no results to the invoking of the function the return will be an empty array.

See also

Filter by label (Content by label)
showLabelsfalse
max15025
showSpacefalse
cqllabel = "project_routine" and space = currentSpace ( )
labelsprojectarray_routineroutines