public class InternalRoles extends Object implements 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 |
"roles": {
"type": "internal",
"internal": {
"path": "${user.home}/.fascinator/roles.properties"
}
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() |
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 |
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(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 PluginDescription getPluginDetails()
getPluginDetails in interface Pluginpublic void init(String jsonString) throws RolesException
init in interface PluginRolesExceptionpublic void init(File jsonFile) throws RolesException
init in interface PluginRolesExceptionpublic void setConfig(JsonSimpleConfig config) throws IOException
IOExceptionpublic void shutdown()
throws RolesException
shutdown in interface PluginRolesExceptionpublic String[] getUsersInRole(String role)
getUsersInRole in interface Rolesrole - The role to search for.public boolean supportsRoleManagement()
supportsRoleManagement in interface Rolespublic void setRole(String username, String newrole) throws RolesException
setRole in interface Rolesusername - The username of the user.newrole - The new role to assign the user.RolesException - if there was an error during assignment.public void removeRole(String username, String oldrole) throws RolesException
removeRole in interface Rolesusername - The username of the user.oldrole - The role to remove from the user.RolesException - if there was an error during removal.public void createRole(String rolename) throws RolesException
createRole in interface Rolesrolename - The name of the new role.RolesException - if there was an error creating the role.public void deleteRole(String rolename) throws RolesException
deleteRole in interface Rolesrolename - The name of the role to delete.RolesException - if there was an error during deletion.public void renameRole(String oldrole, String newrole) throws RolesException
renameRole in interface Rolesoldrole - The name role currently has.newrole - The name role is changing to.RolesException - if there was an error during rename.public String[] searchRoles(String search) throws RolesException
searchRoles in interface Rolessearch - The search string to execute.RolesException - if there was an error searching.Copyright © 2009-2013. All Rights Reserved.