public final class QueryDslPermissionsHelper extends Object
Modifier and Type | Field and Description |
---|---|
static String |
GROUP_PICKER |
static String |
MULTI_GROUP_PICKER |
static String |
MULTI_SELECT |
static String |
SINGLE_SELECT |
Modifier and Type | Method and Description |
---|---|
static com.querydsl.sql.Union<String> |
customFieldIdsWhereGroupCFContainsUser(String userKey)
Returns a list of group custom fields (by id) that a user belongs to in the form customfield_10001.
|
static com.querydsl.sql.SQLQuery<String> |
customFieldIdsWhereUserCFContainsUser(String userKey)
Returns a list of custom fields (by id) that a user belongs to in the form customfield_10001.
|
static com.querydsl.sql.SQLQuery<String> |
groupsContainingUser(String userKey)
Returns a list of groups that a user belongs to.
|
static com.querydsl.core.types.Predicate |
isInProjectRolePredicate(String userKey)
Returns a predicate that can be used to evaluate if a user belongs to any project roles.
|
static com.querydsl.sql.SQLQuery<String> |
licenseRolesContainingUser(String userKey)
Returns a list of application roles that a user belongs to.
|
static com.querydsl.sql.SQLQuery<String> |
projectRoleIdsAsStringForUserKey(String userKey)
Returns a list of project roles (by id) that a user belongs to.
|
static com.querydsl.sql.SQLQuery<String> |
projectRolesForUserKeyQuery(String userKey)
Returns a SQLQuery that can be used to find all projectroles that a user belongs to.
|
static com.querydsl.sql.SQLQuery<SchemePermissionsDTO> |
schemePermissionsForPermissionKeyQuery(String permissionKey)
Returns a SQLSubQuery that can be used to find all schemes that grant the appropriate permissionKey.
|
static com.querydsl.sql.SQLQuery<SchemePermissionsDTO> |
schemePermissionsForPermissionTypeAndKeyQuery(String permissionType,
String permissionKey)
Returns a SQLSubQuery that can be used to find all schemes that grant the appropriate permissionKey to
a grantee permissionType.
|
public static final String MULTI_GROUP_PICKER
public static final String GROUP_PICKER
public static final String MULTI_SELECT
public static final String SINGLE_SELECT
public static com.querydsl.sql.SQLQuery<SchemePermissionsDTO> schemePermissionsForPermissionTypeAndKeyQuery(String permissionType, String permissionKey)
Sample usage:
QSchemePermissions.SCHEME_PERMISSIONS.scheme
.in(schemePermissionsForPermissionTypeAndKeyQuery("lead", "BROWSE_PROJECTS").list(QSchemePermissions.SCHEME_PERMISSIONS));
permissionType
- A String representing the SecurityType
securtiy type that the scheme is granted topermissionKey
- A String representing the ProjectPermissions
permission keypublic static com.querydsl.sql.SQLQuery<SchemePermissionsDTO> schemePermissionsForPermissionKeyQuery(String permissionKey)
Sample usage:
QSchemePermissions.SCHEME_PERMISSIONS.scheme
.in(schemePermissionsForPermissionKeyQuery("BROWSE_PROJECTS").list(QSchemePermissions.SCHEME_PERMISSIONS));
permissionKey
- A String representing the ProjectPermissions
permission keypublic static com.querydsl.sql.SQLQuery<String> groupsContainingUser(String userKey)
Be aware that this will not return shadowed groups, if a user belongs to multiple directories, so is not safe for use BTF. that can be used to find all schemes that grant the appropriate permissionKey.
Sample usage:
Expressions.stringTemplate("administrators").in(groupsContainingUsers("fred"));
userKey
- A String representing the user keypublic static com.querydsl.sql.SQLQuery<String> licenseRolesContainingUser(String userKey)
Sample usage:
Expressions.constant("jira-core").in(licenseRolesContainingUser("fred"));
userKey
- A String representing the user keypublic static com.querydsl.sql.SQLQuery<String> projectRolesForUserKeyQuery(String userKey)
Sample usage:
SCHEME_PERMISSIONS.parameter.in(projectRolesForUserKeyQuery("fred");
userKey
- A String representing the user keypublic static com.querydsl.core.types.Predicate isInProjectRolePredicate(String userKey)
Sample usage:
.where(isInProjectRolePredicate("fred"));
userKey
- A String representing the user keypublic static com.querydsl.sql.SQLQuery<String> projectRoleIdsAsStringForUserKey(String userKey)
Sample usage:
SCHEME_ISSUE_SECURITIES.parameter.in(projectRoleIdsAsStringForUserKey("fred"));
userKey
- A String representing the user keypublic static com.querydsl.sql.SQLQuery<String> customFieldIdsWhereUserCFContainsUser(String userKey)
Sample usage:
SCHEME_ISSUE_SECURITIES.parameter.in(customFieldIdsWhereUserCFContainsUser("fred"));
userKey
- A String representing the user keypublic static com.querydsl.sql.Union<String> customFieldIdsWhereGroupCFContainsUser(String userKey)
Sample usage:
SCHEME_ISSUE_SECURITIES.parameter.in(customFieldIdsWhereGroupCFContainsUser("fred"));
userKey
- A String representing the user keyGroupCF
custom field ids the user belongs to.Copyright © 2002-2016 Atlassian. All Rights Reserved.