/** * Adds a permission. * <p> * This method should not be called after the instance has been made visible to another thread * than the one that constructed it. * </p> * @param permissionName name of the permission to add. Cannot be {@code null} * @param underlyingPermission the permission. Cannot be {@code null} */ public void addUnderlyingPermission(String permissionName, ManagementPermission underlyingPermission) { assert underlyingPermission.getActionEffect() == getActionEffect() : "incompatible ActionEffect"; if (combinationPolicy == CombinationPolicy.REJECTING && underlyingPermissions.size() > 0) { throw ControllerLogger.ROOT_LOGGER.illegalMultipleRoles(); } underlyingPermissions.put(permissionName, underlyingPermission); }
SimpleManagementPermission basePerm = (SimpleManagementPermission) permissionEnumeration.nextElement(); Action.ActionEffect actionEffect = basePerm.getActionEffect(); CombinationManagementPermission combinedPermission = new CombinationManagementPermission(CombinationPolicy.PERMISSIVE, actionEffect); if (scopedPermissions == null) { scopedPermissions = new ManagementPermissionCollection(officialForm, CombinationManagementPermission.class); combinedPermission.addUnderlyingPermission(scopedBaseName, scopedPerm); combinedPermission.addUnderlyingPermission(scopedReadOnlyName, monitorPerm.createScopedPermission(scopingConstraint.getOutofScopeReadConstraint(), constraintIndex));
SimpleManagementPermission basePerm = (SimpleManagementPermission) permissionEnumeration.nextElement(); Action.ActionEffect actionEffect = basePerm.getActionEffect(); CombinationManagementPermission combinedPermission = new CombinationManagementPermission(CombinationPolicy.PERMISSIVE, actionEffect); if (scopedPermissions == null) { scopedPermissions = new ManagementPermissionCollection(officialForm, CombinationManagementPermission.class); combinedPermission.addUnderlyingPermission(scopedBaseName, scopedPerm); combinedPermission.addUnderlyingPermission(scopedReadOnlyName, monitorPerm.createScopedPermission(scopingConstraint.getOutofScopeReadConstraint(), constraintIndex));
SimpleManagementPermission basePerm = (SimpleManagementPermission) permissionEnumeration.nextElement(); Action.ActionEffect actionEffect = basePerm.getActionEffect(); CombinationManagementPermission combinedPermission = new CombinationManagementPermission(CombinationPolicy.PERMISSIVE, actionEffect); if (scopedPermissions == null) { scopedPermissions = new ManagementPermissionCollection(officialForm, CombinationManagementPermission.class); combinedPermission.addUnderlyingPermission(scopedBaseName, scopedPerm); combinedPermission.addUnderlyingPermission(scopedReadOnlyName, monitorPerm.createScopedPermission(scopingConstraint.getOutofScopeReadConstraint(), constraintIndex));
/** * Adds a permission. * <p> * This method should not be called after the instance has been made visible to another thread * than the one that constructed it. * </p> * @param permissionName name of the permission to add. Cannot be {@code null} * @param underlyingPermission the permission. Cannot be {@code null} */ public void addUnderlyingPermission(String permissionName, ManagementPermission underlyingPermission) { assert underlyingPermission.getActionEffect() == getActionEffect() : "incompatible ActionEffect"; if (combinationPolicy == CombinationPolicy.REJECTING && underlyingPermissions.size() > 0) { throw ControllerLogger.ROOT_LOGGER.illegalMultipleRoles(); } underlyingPermissions.put(permissionName, underlyingPermission); }
ManagementPermission mperm = (ManagementPermission) permissionEnumeration.nextElement(); Action.ActionEffect actionEffect = mperm.getActionEffect(); CombinationManagementPermission cmp = new CombinationManagementPermission(combinationPolicy, actionEffect); cmp.addUnderlyingPermission(firstName, mperm); combined.put(actionEffect, cmp); CombinationManagementPermission cmp = combined.get(actionEffect); if (cmp == null) { cmp = new CombinationManagementPermission(combinationPolicy, actionEffect); combined.put(actionEffect, cmp); cmp.addUnderlyingPermission(officialForm, mperm);
/** * Adds a permission. * <p> * This method should not be called after the instance has been made visible to another thread * than the one that constructed it. * </p> * @param permissionName name of the permission to add. Cannot be {@code null} * @param underlyingPermission the permission. Cannot be {@code null} */ public void addUnderlyingPermission(String permissionName, ManagementPermission underlyingPermission) { assert underlyingPermission.getActionEffect() == getActionEffect() : "incompatible ActionEffect"; if (combinationPolicy == CombinationPolicy.REJECTING && underlyingPermissions.size() > 0) { throw ControllerMessages.MESSAGES.illegalMultipleRoles(); } underlyingPermissions.put(permissionName, underlyingPermission); }
ManagementPermission mperm = (ManagementPermission) permissionEnumeration.nextElement(); Action.ActionEffect actionEffect = mperm.getActionEffect(); CombinationManagementPermission cmp = new CombinationManagementPermission(combinationPolicy, actionEffect); cmp.addUnderlyingPermission(firstName, mperm); combined.put(actionEffect, cmp); CombinationManagementPermission cmp = combined.get(actionEffect); if (cmp == null) { cmp = new CombinationManagementPermission(combinationPolicy, actionEffect); combined.put(actionEffect, cmp); cmp.addUnderlyingPermission(officialForm, mperm);
ManagementPermission mperm = (ManagementPermission) permissionEnumeration.nextElement(); Action.ActionEffect actionEffect = mperm.getActionEffect(); CombinationManagementPermission cmp = new CombinationManagementPermission(combinationPolicy, actionEffect); cmp.addUnderlyingPermission(firstName, mperm); combined.put(actionEffect, cmp); CombinationManagementPermission cmp = combined.get(actionEffect); if (cmp == null) { cmp = new CombinationManagementPermission(combinationPolicy, actionEffect); combined.put(actionEffect, cmp); cmp.addUnderlyingPermission(officialForm, mperm);