/** * Finds an existing role or creates a new one if needed. Note that a null * description will be set if the role has to be created. * * @param application * The parent application. * @param name * The role name to find or create. * @return The role found or created. */ public static Role get(Application application, String name) { return get(application, name, null); }
/** * Retrieves an existing role or creates a new one if needed based on its * name. Note that a null description will be set if the role has to be * created. * * @param name * The role name to find or create. * @return The role found or created. */ public Role getRole(String name) { return Role.get(getApplication(), name); }
/** * Unmaps a group defined in a component from a role defined in the * application. * * @param group * The source group. * @param application * The parent application. Can't be null. * @param roleName * The target role name. * @throws IllegalArgumentException * If application is null. */ public void unmap(Group group, Application application, String roleName) { unmap(group, Role.get(application, roleName, null)); }
/** * Maps a user defined in a component to a role defined in the application. * * @param user * The source user. * @param application * The parent application. Can't be null. * @param roleName * The target role name. * @throws IllegalArgumentException * If application is null. */ public void map(User user, Application application, String roleName) { map(user, Role.get(application, roleName, null)); }
/** * Unmaps a user defined in a component from a role defined in the * application. * * @param user * The source user. * @param application * The parent application. Can't be null. * @param roleName * The target role name. * @throws IllegalArgumentException * If application is null. */ public void unmap(User user, Application application, String roleName) { unmap(user, Role.get(application, roleName, null)); }