Class DbAclWriteClient
java.lang.Object
com.illumon.iris.db.v2.permissions.DbAclWriteClient
- All Implemented Interfaces:
DbAclWriter
public class DbAclWriteClient extends Object implements DbAclWriter
-
Constructor Summary
Constructors Constructor Description DbAclWriteClient(com.fishlib.io.sched.Scheduler scheduler, com.fishlib.io.logger.Logger logger)
-
Method Summary
Modifier and Type Method Description int
addAcl(String group, String ns, String table, String acl)
Adds an ACL entry.int
addColumnAcl(String group, String ns, String table, String columns, String acl)
Adds a Column ACL entry.void
addGroupStrategy(String group, String strategy)
For AccountFilterGenerator() there are two levels of mappings.int
addInputTableEditor(String group, String ns, String table, boolean canEdit)
Adds an entry to the ACL database for editing an input table.void
addMembership(String user, List<String> groups)
Adds a user to a list of groups If the user could not be added to all of the groups, a RuntimeException is thrown.int
addOrUpdateSystemUserAcl(String user, String systemUser)
Inserts or Updates an entry to the ACL database for run-as mappingvoid
addStrategyAccount(String strategy, String account)
For AccountFilterGenerator() there are two levels of mappings.int
addSystemAcl(String group, String key, String acl)
Adds a system ACL entry.void
addUser(String user, String passwordHash)
Adds a user to the Iris system.boolean
authenticate(com.fishlib.auth.AuthToken authToken)
void
changePassword(String user, String passwordHash)
Changes the password for a user.void
deleteAcls(String group, String ns, String table)
Deletes an ACL entry for a group and table.void
deleteAllAclData()
Deletes all data in the ACL store.void
deleteColumnAcls(String group, String ns, String table, String columns)
Deletes a Column ACL entry for a group, table, and column set.void
deleteGroup(String group)
Deletes a group.void
deleteGroupStrategy(String group, String strategy)
For AccountFilterGenerator() there are two levels of mappings.void
deleteInputTableEditor(String group, String ns, String table)
Deletes an entry to the ACL database for editing an input table.void
deleteStrategyAccount(String strategy, String account)
For AccountFilterGenerator() there are two levels of mappings.void
deleteSystemAcls(String group, String key)
Deletes a system ACL entry for a group and key.void
deleteSystemUserAcl(String user)
Removes an entry from the ACL database for run-as mappingvoid
deleteUser(String user)
The user is deleted.void
removeMembership(String user, List<String> groups)
Removes a user from a list of groups.int
updateAcl(String group, String ns, String table, String acl)
Changes an already existent ACL entry.int
updateColumnAcl(String group, String ns, String table, String columns, String acl)
Changes an already existent Column ACL entry.int
updateInputTableEditor(String group, String ns, String table, boolean canEdit)
Updates an entry to the ACL database for editing an input table.int
updateSystemAcl(String group, String key, String acl)
Changes an already existent system ACL entry.
-
Constructor Details
-
DbAclWriteClient
public DbAclWriteClient(com.fishlib.io.sched.Scheduler scheduler, com.fishlib.io.logger.Logger logger) throws IOException- Throws:
IOException
-
-
Method Details
-
authenticate
public boolean authenticate(com.fishlib.auth.AuthToken authToken) -
addUser
Description copied from interface:DbAclWriter
Adds a user to the Iris system.- Specified by:
addUser
in interfaceDbAclWriter
- Parameters:
user
- the user to add.passwordHash
- the APR1 hash of the user's password. Ignored if the system is not configured to manage user authentication.- Throws:
SQLException
- if the underlying SQL operation could not be completed
-
changePassword
Description copied from interface:DbAclWriter
Changes the password for a user.- Specified by:
changePassword
in interfaceDbAclWriter
- Parameters:
user
- the user to change a password for.passwordHash
- the APR1 hash of the user's password.- Throws:
SQLException
- if the underlying SQL operation could not be completed
-
addMembership
Description copied from interface:DbAclWriter
Adds a user to a list of groups If the user could not be added to all of the groups, a RuntimeException is thrown.- Specified by:
addMembership
in interfaceDbAclWriter
- Parameters:
user
- the user to add to the groupsgroups
- a list of groups to add the user to
-
removeMembership
Description copied from interface:DbAclWriter
Removes a user from a list of groups. It is possible that the user may be removed from some groups and not others. If the user could not be removed from all of the specified groups (e.g., because they are not a member of those groups), a runtime exception is thrown.- Specified by:
removeMembership
in interfaceDbAclWriter
- Parameters:
user
- the user to remove from groupsgroups
- a list of groups to remove the user from- Throws:
SQLException
- if the underlying SQL operation could not be completed
-
deleteGroup
Description copied from interface:DbAclWriter
Deletes a group. The group is removed from all user to group mappings, all group to strategy mappings. All table ACLs and input table editors that reference the group are deleted.- Specified by:
deleteGroup
in interfaceDbAclWriter
- Parameters:
group
- the group to delete.- Throws:
SQLException
- if the underlying SQL operation could not be completed
-
deleteUser
Description copied from interface:DbAclWriter
The user is deleted. Deletes the user's group, followed by deleting any other user to group associations for the user. If managed authentication is enabled, also deletes the user's password.- Specified by:
deleteUser
in interfaceDbAclWriter
- Parameters:
user
- the user to delete- Throws:
SQLException
- if the underlying SQL operation could not be completed
-
addGroupStrategy
Description copied from interface:DbAclWriter
For AccountFilterGenerator() there are two levels of mappings. Group to strategy and strategy to account. This will add a group to the intermediate "strategy".- Specified by:
addGroupStrategy
in interfaceDbAclWriter
- Parameters:
group
- the group to map to a strategystrategy
- the strategy that the group is added to- Throws:
SQLException
- if the underlying SQL operation could not be completed
-
deleteGroupStrategy
Description copied from interface:DbAclWriter
For AccountFilterGenerator() there are two levels of mappings. Group to strategy and strategy to account. This will remove a group from the intermediate "strategy".- Specified by:
deleteGroupStrategy
in interfaceDbAclWriter
- Parameters:
group
- the group to remove a mapping to a strategystrategy
- the strategy that the group is removed from- Throws:
SQLException
- if the underlying SQL operation could not be completed
-
addStrategyAccount
Description copied from interface:DbAclWriter
For AccountFilterGenerator() there are two levels of mappings. Group to strategy and strategy to account. This will add an account to the intermediate "strategy".- Specified by:
addStrategyAccount
in interfaceDbAclWriter
- Parameters:
strategy
- the strategy that the account is added toaccount
- the account to add to a strategy- Throws:
SQLException
- if the underlying SQL operation could not be completed
-
deleteStrategyAccount
Description copied from interface:DbAclWriter
For AccountFilterGenerator() there are two levels of mappings. Group to strategy and strategy to account. This will remove an account from the intermediate "strategy".- Specified by:
deleteStrategyAccount
in interfaceDbAclWriter
- Parameters:
strategy
- the strategy that the account is added toaccount
- the account to add to a strategy- Throws:
SQLException
- if the underlying SQL operation could not be completed
-
addAcl
Description copied from interface:DbAclWriter
Adds an ACL entry. No ACL entry may currently exist for the group and table in question.- Specified by:
addAcl
in interfaceDbAclWriter
- Parameters:
group
- the group to add the entry forns
- the namespace to add the entry for ("*" for all namespaces)table
- the namespace to add the entry for ("*" for tables within a namespace, if ns is "*" table must also be "*")acl
- the ACL to add, see http://wiki.illumon.com/Iris/Permissions#Table_Access_Control_Lists_.28ACLs.29- Returns:
- the number of rows within the ACL database that were modified.
- Throws:
SQLException
- if the underlying SQL operation could not be completed
-
updateAcl
Description copied from interface:DbAclWriter
Changes an already existent ACL entry. An ACL entry must currently exist for the group and table in question.- Specified by:
updateAcl
in interfaceDbAclWriter
- Parameters:
group
- the group to update the entry forns
- the namespace to update the entry for ("*" for all namespaces)table
- the namespace to update the entry for ("*" for tables within a namespace, if ns is "*" table must also be "*")acl
- the new ACL, see http://wiki.illumon.com/Iris/Permissions#Table_Access_Control_Lists_.28ACLs.29- Returns:
- the number of rows within the ACL database that were modified.
- Throws:
SQLException
- if the underlying SQL operation could not be completed
-
deleteAcls
Description copied from interface:DbAclWriter
Deletes an ACL entry for a group and table.- Specified by:
deleteAcls
in interfaceDbAclWriter
- Parameters:
group
- the group to remove the entry forns
- the namespace to remove the entry for ("*" for all namespaces)table
- the namespace to remove the entry for ("*" for tables within a namespace, if ns is "*" table must also be "*")- Throws:
SQLException
- if the underlying SQL operation could not be completed
-
addColumnAcl
public int addColumnAcl(String group, String ns, String table, String columns, String acl) throws SQLExceptionDescription copied from interface:DbAclWriter
Adds a Column ACL entry. No ACL entry may currently exist for the group and table in question.- Specified by:
addColumnAcl
in interfaceDbAclWriter
- Parameters:
group
- the group to add the entry forns
- the namespace to add the entry for ("*" for all namespaces)table
- the namespace to add the entry for ("*" for tables within a namespace, if ns is "*" table must also be "*")columns
- the columns the ACL applies toacl
- the ACL to add, see http://wiki.illumon.com/Iris/Permissions#Table_Access_Control_Lists_.28ACLs.29- Returns:
- the number of rows within the ACL database that were modified.
- Throws:
SQLException
- if the underlying SQL operation could not be completed
-
updateColumnAcl
public int updateColumnAcl(String group, String ns, String table, String columns, String acl) throws SQLExceptionDescription copied from interface:DbAclWriter
Changes an already existent Column ACL entry. An ACL entry must currently exist for the group, table, and column set in question.- Specified by:
updateColumnAcl
in interfaceDbAclWriter
- Parameters:
group
- the group to update the entry forns
- the namespace to update the entry for ("*" for all namespaces)table
- the namespace to update the entry for ("*" for tables within a namespace, if ns is "*" table must also be "*")columns
- the columns the ACL applies toacl
- the new ACL, see http://wiki.illumon.com/Iris/Permissions#Table_Access_Control_Lists_.28ACLs.29- Returns:
- the number of rows within the ACL database that were modified.
- Throws:
SQLException
- if the underlying SQL operation could not be completed
-
deleteColumnAcls
public void deleteColumnAcls(String group, String ns, String table, String columns) throws SQLExceptionDescription copied from interface:DbAclWriter
Deletes a Column ACL entry for a group, table, and column set.- Specified by:
deleteColumnAcls
in interfaceDbAclWriter
- Parameters:
group
- the group to remove the entry forns
- the namespace to add the entry for ("*" for all namespaces)table
- the namespace to add the entry for ("*" for tables within a namespace, if ns is "*" table must also be "*")columns
- the applicable columne set- Throws:
SQLException
- if the underlying SQL operation could not be completed
-
addSystemAcl
Description copied from interface:DbAclWriter
Adds a system ACL entry. No ACL entry may currently exist for the group and key in question.- Specified by:
addSystemAcl
in interfaceDbAclWriter
- Parameters:
group
- the group to add the entry forkey
- the key to add the entry for (wildcard not allowed)acl
- the ACL to add, see http://wiki.illumon.com/Iris/Permissions#Table_Access_Control_Lists_.28ACLs.29- Returns:
- the number of rows within the ACL database that were modified.
- Throws:
SQLException
- if the underlying SQL operation could not be completed
-
updateSystemAcl
Description copied from interface:DbAclWriter
Changes an already existent system ACL entry. An ACL entry must currently exist for the group and key in question.- Specified by:
updateSystemAcl
in interfaceDbAclWriter
- Parameters:
group
- the group to update the entry forkey
- the key to update the entry for (no wildcard)acl
- the new ACL, see http://wiki.illumon.com/Iris/Permissions#Table_Access_Control_Lists_.28ACLs.29- Returns:
- the number of rows within the ACL database that were modified.
- Throws:
SQLException
- if the underlying SQL operation could not be completed
-
deleteSystemAcls
Description copied from interface:DbAclWriter
Deletes a system ACL entry for a group and key.- Specified by:
deleteSystemAcls
in interfaceDbAclWriter
- Parameters:
group
- the group to remove the entry forkey
- the namespace to add the entry for (wildcard not allowed)- Throws:
SQLException
- if the underlying SQL operation could not be completed
-
addInputTableEditor
public int addInputTableEditor(String group, String ns, String table, boolean canEdit) throws SQLExceptionDescription copied from interface:DbAclWriter
Adds an entry to the ACL database for editing an input table.- Specified by:
addInputTableEditor
in interfaceDbAclWriter
- Parameters:
group
- the group to add the entry forns
- the namespace to add the entry for ("*" for all namespaces)table
- the namespace to add the entry for ("*" for tables within a namespace, if ns is "*" table must also be "*")canEdit
- whether the table is editable for this group- Returns:
- the number of rows within the ACL database that were modified.
- Throws:
SQLException
- if the underlying SQL operation could not be completed
-
updateInputTableEditor
public int updateInputTableEditor(String group, String ns, String table, boolean canEdit) throws SQLExceptionDescription copied from interface:DbAclWriter
Updates an entry to the ACL database for editing an input table.- Specified by:
updateInputTableEditor
in interfaceDbAclWriter
- Parameters:
group
- the group to update the entry forns
- the namespace to update the entry for ("*" for all namespaces)table
- the namespace to update the entry for ("*" for tables within a namespace, if ns is "*" table must also be "*")canEdit
- whether the table is editable for this group- Returns:
- the number of rows within the ACL database that were modified.
- Throws:
SQLException
- if the underlying SQL operation could not be completed
-
deleteInputTableEditor
Description copied from interface:DbAclWriter
Deletes an entry to the ACL database for editing an input table.- Specified by:
deleteInputTableEditor
in interfaceDbAclWriter
- Parameters:
group
- the group to delete the entry forns
- the namespace to delete the entry for ("*" for all namespaces)table
- the namespace to delete the entry for ("*" for tables within a namespace, if ns is "*" table must also be "*")- Throws:
SQLException
- if the underlying SQL operation could not be completed
-
addOrUpdateSystemUserAcl
Description copied from interface:DbAclWriter
Inserts or Updates an entry to the ACL database for run-as mapping- Specified by:
addOrUpdateSystemUserAcl
in interfaceDbAclWriter
- Parameters:
user
- the user whose system-user mapping is to be updatedsystemUser
- the system-user which will be used for launching workers- Returns:
- the number of rows within the ACL database that were modified
- Throws:
SQLException
- if the underlying SQL operation could not be completed
-
deleteSystemUserAcl
Description copied from interface:DbAclWriter
Removes an entry from the ACL database for run-as mapping- Specified by:
deleteSystemUserAcl
in interfaceDbAclWriter
- Parameters:
user
- the user whose system-user mapping is to be deleted- Throws:
SQLException
- if the underlying SQL operation could not be completed
-
deleteAllAclData
Description copied from interface:DbAclWriter
Deletes all data in the ACL store. Use judiciously.- Specified by:
deleteAllAclData
in interfaceDbAclWriter
- Throws:
SQLException
-