public class InternalRoles extends Object implements com.googlecode.fascinator.api.roles.Roles
This plugin implements the Fascinator default internal roles.
Standard configuration table:
| Option | Description | Required | Default |
|---|---|---|---|
| internal/path | File path in which the roles information is stored | Yes | ${user.home}/.fascinator/roles.properties |
| internal/defaultRoles | A list of roles to apply to a user when there is no role configuration applied | No | [] |
"roles": {
"type": "internal",
"internal": {
"path": "${user.home}/.fascinator/roles.properties",
"defaultRoles": ["librarian"]
}
None
| Constructor and Description |
|---|
InternalRoles() |
| Modifier and Type | Method and Description |
|---|---|
void |
createRole(String rolename)
Create a role.
|
void |
deleteRole(String rolename)
Delete a role.
|
String |
getId() |
String |
getName() |
com.googlecode.fascinator.api.PluginDescription |
getPluginDetails()
Gets a PluginDescription object relating to this plugin.
|
String[] |
getRoles(String username)
Find and return all roles this user has.
|
String[] |
getUsersInRole(String role)
Returns a list of users who have a particular role.
|
void |
init(File jsonFile) |
void |
init(String jsonString) |
void |
loadRoles() |
void |
removeRole(String username,
String oldrole)
Remove a role from a user.
|
void |
renameRole(String oldrole,
String newrole)
Rename a role.
|
String[] |
searchRoles(String search)
Returns a list of roles matching the search.
|
void |
setConfig(com.googlecode.fascinator.common.JsonSimpleConfig config) |
void |
setRole(String username,
String newrole)
Assign a role to a user.
|
void |
shutdown() |
boolean |
supportsRoleManagement()
Method for testing if the implementing plugin allows
the creation, deletion and modification of roles.
|
public String getId()
getId in interface com.googlecode.fascinator.api.Pluginpublic String getName()
getName in interface com.googlecode.fascinator.api.Pluginpublic com.googlecode.fascinator.api.PluginDescription getPluginDetails()
getPluginDetails in interface com.googlecode.fascinator.api.Pluginpublic void init(String jsonString) throws com.googlecode.fascinator.api.roles.RolesException
init in interface com.googlecode.fascinator.api.Plugincom.googlecode.fascinator.api.roles.RolesExceptionpublic void init(File jsonFile) throws com.googlecode.fascinator.api.roles.RolesException
init in interface com.googlecode.fascinator.api.Plugincom.googlecode.fascinator.api.roles.RolesExceptionpublic void setConfig(com.googlecode.fascinator.common.JsonSimpleConfig config)
throws IOException
IOExceptionpublic void loadRoles()
throws IOException
IOExceptionpublic void shutdown()
throws com.googlecode.fascinator.api.roles.RolesException
shutdown in interface com.googlecode.fascinator.api.Plugincom.googlecode.fascinator.api.roles.RolesExceptionpublic String[] getRoles(String username)
getRoles in interface com.googlecode.fascinator.api.roles.Rolesusername - The username of the user.public String[] getUsersInRole(String role)
getUsersInRole in interface com.googlecode.fascinator.api.roles.Rolesrole - The role to search for.public boolean supportsRoleManagement()
supportsRoleManagement in interface com.googlecode.fascinator.api.roles.Rolespublic void setRole(String username, String newrole) throws com.googlecode.fascinator.api.roles.RolesException
setRole in interface com.googlecode.fascinator.api.roles.Rolesusername - The username of the user.newrole - The new role to assign the user.com.googlecode.fascinator.api.roles.RolesException - if there was an error during assignment.public void removeRole(String username, String oldrole) throws com.googlecode.fascinator.api.roles.RolesException
removeRole in interface com.googlecode.fascinator.api.roles.Rolesusername - The username of the user.oldrole - The role to remove from the user.com.googlecode.fascinator.api.roles.RolesException - if there was an error during removal.public void createRole(String rolename) throws com.googlecode.fascinator.api.roles.RolesException
createRole in interface com.googlecode.fascinator.api.roles.Rolesrolename - The name of the new role.com.googlecode.fascinator.api.roles.RolesException - if there was an error creating the role.public void deleteRole(String rolename) throws com.googlecode.fascinator.api.roles.RolesException
deleteRole in interface com.googlecode.fascinator.api.roles.Rolesrolename - The name of the role to delete.com.googlecode.fascinator.api.roles.RolesException - if there was an error during deletion.public void renameRole(String oldrole, String newrole) throws com.googlecode.fascinator.api.roles.RolesException
renameRole in interface com.googlecode.fascinator.api.roles.Rolesoldrole - The name role currently has.newrole - The name role is changing to.com.googlecode.fascinator.api.roles.RolesException - if there was an error during rename.public String[] searchRoles(String search) throws com.googlecode.fascinator.api.roles.RolesException
searchRoles in interface com.googlecode.fascinator.api.roles.Rolessearch - The search string to execute.com.googlecode.fascinator.api.roles.RolesException - if there was an error searching.Copyright © 2009-2016. All Rights Reserved.