admShareFilter

Looking for the documentation on the newest versions of SIL Engine and the Simple Issue Language for Jira 8 for Server/Data Center?Ā Click hereĀ !

Availability

This routine is available starting withĀ SIL Engine 4.8.0.4.

Syntax

admShareFilter(filterId, shareType, [ shareRight [, shareName [,roleName ]]])

Description

Add shares to a filter based on project, role, group, user.Add shares to a filter based on project, role, group, user. For each call of this routine a new set of shares will be added on top of the existing ones.

Parameters

Parameter name

Type

Required

Description

filterId

number

Yes

The filter id.

shareType
stringYes

The share type.

The share type can be: "project", "group", "user", "global", "loggedin".

shareRightĀ 
stringNo

The share right.

The share right can be: "view", "edit".

shareNameĀ 
stringNo

The share name is dependent of the share type. It represents the actual name of the project, user or group for sharing the filter.

For the project shareType the shareName is the actual key of the project.

For the group shareType the shareName is the group name.

For the user shareType the shareName is the user name.

roleNameĀ stringNoThe role name is an extra parameter when sharing the filter on a project that will further restrict based on role as well.


Return type

boolean

Returns true if the operation succeeded.

Example

number filterId = createFilter("TestFilter", "Description", "project = TEST", "admin"); // this will create a filter with no shares(private filter)


// for global and loggedin share type, the default shareRight is view 
admShareFilter(filterId , "global"); // all the users(logged in or not will have view permissions for the created filter)
admShareFilter(filterId , "loggedin"); // only the logged in users will have the permissions for this filter (also only for viewing)


//the user admin will have permissions for both view and editing
admShareFilter(filterId , "user", "view" ,"admin");
admShareFilter(filterId , "user", "edit" ,"admin");


//the permissions are now set for project test for view and edit
admShareFilter(filterId , "project", "view" ,"TEST");
admShareFilter(filterId , "project", "edit" ,"TEST");


//the permissions are now set for project test for view and edit AND as an extra restriction based on the "Administrators" role
admShareFilter(filterId , "project", "view" ,"TEST","Administrators");
admShareFilter(filterId , "project", "edit" ,"TEST", "Administrators");

//the users from the "jira-administrators" group will have permissions for this filter
admShareFilter(filterId , "group", "view" ,"jira-administrators");
admShareFilter(filterId , "group", "edit" ,"jira-administrators");