|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.atlassian.bamboo.security.acegi.acls.BambooAclUpdateHelper
public class BambooAclUpdateHelper
A helper class used in Acl update and creation operations
It converts betweenAcl
and AccessControlEntry
objects and a "permissionKey" which is a String
representation of a Acl
and AccessControlEntry
combination.
The "permissionKeys" are in the format: bambooPermission_TYPE_PRINCIPAL_PERMISSION
The permission configuration UI understands this format.
Field Summary | |
---|---|
static String |
BAMBOO_PERMISSION_FORM_GROUP
|
static String |
BAMBOO_PERMISSION_FORM_GROUP_PREFIX
|
static String |
BAMBOO_PERMISSION_FORM_ROLE
|
static String |
BAMBOO_PERMISSION_FORM_ROLE_PREFIX
|
static String |
BAMBOO_PERMISSION_FORM_SEPARATOR
|
static String |
BAMBOO_PERMISSION_FORM_USER
|
static String |
BAMBOO_PERMISSION_FORM_USER_PREFIX
|
static String |
BAMBOO_PERMISSION_PREFIX
|
Constructor Summary | |
---|---|
BambooAclUpdateHelper()
|
Method Summary | |
---|---|
List<String> |
addViewPermissionsForEditPermissions(List<String> permissionKeys)
For each of the WRITE permission keys in the list make sure there's corresponding READ permission. |
void |
buildPermissionAndUserGroupListsFromAcl(List<String> grantedPermissions,
List<String> grantedUsers,
List<String> grantedGroups,
List<String> nonProcessedGrantedPermissions,
org.acegisecurity.acls.Acl acl,
boolean showAdminPermissions,
BambooPermissionManager bambooPermissionManager)
Helper conversion method for the permission configuration pages. |
List<String> |
buildPermissionListFromRequest(Map<String,String[]> params)
Builds a list of permissionKeys from the request Map |
void |
buildUserGroupListsFromPermissions(List<String> grantedPermissions,
List<String> grantedUsers,
List<String> grantedGroups)
Given a list of granted permissions (permissionKey String s), it will populate the grantedUsers list with
unique usernames of those users which have permissions. |
org.acegisecurity.acls.MutableAcl |
clonePermissions(com.atlassian.user.User user,
Class<? extends BambooIdProvider> permissionObject,
long id,
org.acegisecurity.acls.Acl parentAcl)
|
org.acegisecurity.acls.MutableAcl |
copyProjectPermissionsToEnvironment(com.atlassian.user.User user,
Class<? extends BambooIdProvider> permissionObject,
long id,
org.acegisecurity.acls.Acl parentAcl)
|
org.acegisecurity.acls.MutableAcl |
createNewDefaultAcl(com.atlassian.user.User user,
Class<? extends Plan> planType)
Creates a default Acl for a specific plan types which has: - All permissions for the creator (user argument) of the plan - READ permission for all logged in users - READ permission for all anonymous users |
org.acegisecurity.acls.MutableAcl |
createNewObjectAcl(com.atlassian.user.User user,
Class<? extends BambooIdProvider> permissionObject,
long id)
Creates a default Acl for a object which has: - EDIT permission for the creator (user argument) of the deployment project - READ permission for all logged in users - READ permission for all anonymous users |
org.acegisecurity.acls.Permission |
getPermission(String permissionKey)
|
String |
getPermissionKeyFromAce(org.acegisecurity.acls.AccessControlEntry ace)
Given an AccessControlEntry return a String representation. |
void |
modifyAclAces(org.acegisecurity.acls.MutableAcl acl,
List<String> newPermissionKeys)
Updates an MutableAcl with new AccessControlEntry s with permissions represented by a list of
String permissionKeys. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String BAMBOO_PERMISSION_FORM_SEPARATOR
public static final String BAMBOO_PERMISSION_FORM_USER
public static final String BAMBOO_PERMISSION_FORM_GROUP
public static final String BAMBOO_PERMISSION_FORM_ROLE
public static String BAMBOO_PERMISSION_PREFIX
public static final String BAMBOO_PERMISSION_FORM_USER_PREFIX
public static final String BAMBOO_PERMISSION_FORM_GROUP_PREFIX
public static final String BAMBOO_PERMISSION_FORM_ROLE_PREFIX
Constructor Detail |
---|
public BambooAclUpdateHelper()
Method Detail |
---|
public List<String> buildPermissionListFromRequest(Map<String,String[]> params)
Map
params
- - param list from action.
List
of String
s representing permissions in the request mappublic void buildUserGroupListsFromPermissions(List<String> grantedPermissions, List<String> grantedUsers, List<String> grantedGroups)
String
s), it will populate the grantedUsers list with
unique usernames of those users which have permissions. Likewise, it will populate the grantedGroups list with
unique group names of those groups which have permissions.
grantedPermissions
- grantedUsers
- grantedGroups
- @NotNull public List<String> addViewPermissionsForEditPermissions(@NotNull List<String> permissionKeys)
public void buildPermissionAndUserGroupListsFromAcl(@NotNull List<String> grantedPermissions, @NotNull List<String> grantedUsers, @NotNull List<String> grantedGroups, @NotNull List<String> nonProcessedGrantedPermissions, @NotNull org.acegisecurity.acls.Acl acl, boolean showAdminPermissions, @NotNull BambooPermissionManager bambooPermissionManager)
Acl
and populates three lists from this Acl: - grantedPermissions - a list of String
in format: bambooPermission_TYPE_PRINCIPAL_PERMISSION - grantedUsers - a list of String
usernames - who
have at least one AccessControlEntry
against the Acl
- grantedGroups - a list of String
groupnames - who have at least one AccessControlEntry
against the Acl
-
nonProcessedGrantedPermissions - a list of permissions, that are not processed - so could not be changed here. It
is introduced to avoid cleaning up permissions, that are not visible for user performing this action
grantedPermissions
- grantedUsers
- grantedGroups
- nonProcessedGrantedPermissions
- acl
- showAdminPermissions
- bambooPermissionManager
- public void modifyAclAces(org.acegisecurity.acls.MutableAcl acl, List<String> newPermissionKeys)
MutableAcl
with new AccessControlEntry
s with permissions represented by a list of
String
permissionKeys.
acl
- newPermissionKeys
- public String getPermissionKeyFromAce(org.acegisecurity.acls.AccessControlEntry ace)
AccessControlEntry
return a String
representation.
ace
-
public org.acegisecurity.acls.MutableAcl createNewDefaultAcl(@NotNull com.atlassian.user.User user, Class<? extends Plan> planType)
user
- to create acl for.planType
- to create acl for.
MutableAcl
representing a default permission set@NotNull public org.acegisecurity.acls.MutableAcl createNewObjectAcl(@NotNull com.atlassian.user.User user, Class<? extends BambooIdProvider> permissionObject, long id)
user
- to create acl for.permissionObject
- to create acl for.
MutableAcl
representing a default permission set@NotNull public org.acegisecurity.acls.MutableAcl copyProjectPermissionsToEnvironment(@NotNull com.atlassian.user.User user, Class<? extends BambooIdProvider> permissionObject, long id, org.acegisecurity.acls.Acl parentAcl)
@NotNull public org.acegisecurity.acls.MutableAcl clonePermissions(@NotNull com.atlassian.user.User user, Class<? extends BambooIdProvider> permissionObject, long id, org.acegisecurity.acls.Acl parentAcl)
public org.acegisecurity.acls.Permission getPermission(String permissionKey)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |