Interface DbAclProvider
- All Superinterfaces:
DbAclWriter
- All Known Implementing Classes:
EtcdDbAclGuiHelper
,EtcdDbAclProvider
,MysqlDbAclGuiHelper
,MysqlDbAclProvider
,PermissionFilterProviderEtcdImpl
,PermissionFilterProviderMysqlImpl
,UnauthenticatedPermissionFilterProviderEtcdImpl
,UnauthenticatedPermissionFilterProviderMysqlImpl
public interface DbAclProvider extends DbAclWriter
-
Method Summary
Modifier and Type Method Description boolean
canAnyoneEditInputTable(String namespace, String tableName)
Checks whether an input table can be edited by all usersboolean
canEditInputTable(String effectiveUser, String namespace, String tableName)
Checks whether a user has rights to edit an input tablevoid
changePassword(String user, String passwordHash)
Changes the password of a user entry in passwdvoid
close()
String[]
getAccountsForGroup(String group)
Retrieves all strategy accounts associated with a particular groupString[]
getAccountsForStrategy(String strategy)
Retrieves all strategy accounts associated with a particular strategyString[]
getAccountsForUser(String effectiveUser)
Retrieves all strategy accounts associated with a user, directly or through group membershipString[]
getAllAccounts()
Retrieves all strategy accounts in the systemString[]
getAllGroups()
Retrieves all groups accounts in the systemString[]
getAllStrategies()
Retrieves all strategy names by unioning strategies in strategyaccount with those in groupstrategyString[]
getAllUsers()
Retrieves all user accounts in the systemList<PermissionFilterProvider.FilterDetails>
getFilterDetailsForUser(com.fishlib.auth.UserContext userContext)
Gets the tableacls permissions filters for an effective userString[]
getGroupsForUser(String effectiveUser)
Get the groups to which a user is mappedList<com.fishlib.base.Pair<String,String>>
getPasswdsForMigration()
Returns user and password entries from the passwd table.String
getRunAsUser(String effectiveUser)
Returns the systemuser to which the effectiveUser is mapped, or null if no mapping exists.Map<String,String>
getRunAsUserMap()
Returns a map of user names to systemuser namesString[]
getStrategiesForGroup(String group)
Retrieves all strategies associated with a particular groupString[]
getStrategiesForUser(String effectiveUser)
Retrieves all strategies associated with a particular user, either directly or through group membershipString[]
getStrategyForAccount(String account)
Retrieves all strategies associated with a particular strategy accountString[]
getSystemUsers()
Returns an array of systemusers.String[]
getUsersForGroup(String group)
Get the users that are members of a groupboolean
groupStrategyExists(String groupName, String strategy)
Checks whether a particular association of a group and a strategy existsMap<String,List<com.fishlib.base.Pair<String,String>>>
retrieveColumnAcls(String effectiveUser, String namespace, String tableName)
Returns the most specific columnacl per group for a specific user, namespace, and table.Collection<String>
retrieveRowAcls(String effectiveUser, String namespace, String tableName)
Returns the most specific tableacl per group for a specific user, namespace, and table.Collection<String>
retrieveSystemAcls(String effectiveUser, String key)
Retrieve the set of system ACLs that modify system behavior rather than table access.Methods inherited from interface com.illumon.iris.db.v2.permissions.DbAclWriter
addAcl, addColumnAcl, addGroupStrategy, addInputTableEditor, addMembership, addOrUpdateSystemUserAcl, addStrategyAccount, addSystemAcl, addUser, deleteAcls, deleteAllAclData, deleteColumnAcls, deleteGroup, deleteGroupStrategy, deleteInputTableEditor, deleteStrategyAccount, deleteSystemAcls, deleteSystemUserAcl, deleteUser, removeMembership, updateAcl, updateColumnAcl, updateInputTableEditor, updateSystemAcl
-
Method Details
-
getFilterDetailsForUser
@NotNull List<PermissionFilterProvider.FilterDetails> getFilterDetailsForUser(com.fishlib.auth.UserContext userContext)Gets the tableacls permissions filters for an effective user- Parameters:
userContext
- TheUserContext
from which the effective user name to filter will be obtained- Returns:
- A List of
PermissionFilterProvider.FilterDetails
for the effective user
-
retrieveRowAcls
@NotNull Collection<String> retrieveRowAcls(String effectiveUser, String namespace, String tableName)Returns the most specific tableacl per group for a specific user, namespace, and table.- Parameters:
effectiveUser
- the user for which acls should be retrievednamespace
- the namespace specifically for which acls should be retrieved - will also match * in tableaclstableName
- the table name specifically for which acls should be retrieved - will also match * in tableacls- Returns:
- A Collection of tableacls filters.
-
retrieveColumnAcls
@NotNull Map<String,List<com.fishlib.base.Pair<String,String>>> retrieveColumnAcls(String effectiveUser, String namespace, String tableName)Returns the most specific columnacl per group for a specific user, namespace, and table.- Parameters:
effectiveUser
- the user for which acls should be retrievednamespace
- the namespace specifically for which acls should be retrieved - will also match * in columnaclstableName
- the table name specifically for which acls should be retrieved - will also match * in columnacls- Returns:
- A Map of group names to Lists of columns and filter pairs.
-
retrieveSystemAcls
Retrieve the set of system ACLs that modify system behavior rather than table access.- Parameters:
effectiveUser
- The user to get ACLs forkey
- The lookup value that applies- Returns:
- A collection of strings representing the applicable ACLs.
-
canEditInputTable
Checks whether a user has rights to edit an input table- Parameters:
effectiveUser
- The user for whom permissions should be checkednamespace
- the namespace specifically for which acls should be retrieved - will also match * in inputtableeditorstableName
- the table name specifically for which acls should be retrieved - will also match * in inputtableeditors- Returns:
- True if the user has an effective canedit grant, otherwise false
-
canAnyoneEditInputTable
Checks whether an input table can be edited by all users- Parameters:
namespace
- the namespace specifically for which acls should be retrieved - will also match * in inputtableeditorstableName
- the table name specifically for which acls should be retrieved - will also match * in inputtableeditors- Returns:
- True if the input table can be edited by all users, otherwise false
-
getAccountsForUser
Retrieves all strategy accounts associated with a user, directly or through group membership- Parameters:
effectiveUser
- The user for whom strategy account access should be checked- Returns:
- An array of String of associated strategy accounts
-
getAllUsers
Retrieves all user accounts in the system- Returns:
- An array of String of user names
-
getAllGroups
Retrieves all groups accounts in the system- Returns:
- An array of String of groups names
-
getAllStrategies
Retrieves all strategy names by unioning strategies in strategyaccount with those in groupstrategy- Returns:
- An array of String of strategy names
- Throws:
SQLException
- In the case of SQL implementations of this interface if something goes wrong
-
getAllAccounts
Retrieves all strategy accounts in the system- Returns:
- An array of String of strategy account names
- Throws:
SQLException
- In the case of SQL implementations of this interface if something goes wrong
-
getAccountsForStrategy
Retrieves all strategy accounts associated with a particular strategy- Parameters:
strategy
- The strategy name for which to filter accounts- Returns:
- An array of String of strategy account names
-
getStrategyForAccount
Retrieves all strategies associated with a particular strategy account- Parameters:
account
- The strategy account name for which to filter strategies- Returns:
- An array of String of strategy account names
-
getAccountsForGroup
Retrieves all strategy accounts associated with a particular group- Parameters:
group
- The group name for which to filter accounts- Returns:
- An array of String of strategy account names
-
getStrategiesForGroup
Retrieves all strategies associated with a particular group- Parameters:
group
- The group name for which to filter strategies- Returns:
- An array of String of strategy names
-
groupStrategyExists
Checks whether a particular association of a group and a strategy exists- Parameters:
groupName
- The group name to checkstrategy
- The strategy name to check- Returns:
- True if the mapping exists, false if it does not
-
getGroupsForUser
Get the groups to which a user is mapped- Parameters:
effectiveUser
- The String name of the user to find groups for- Returns:
- A String array of groups mapped to this user
-
getStrategiesForUser
Retrieves all strategies associated with a particular user, either directly or through group membership- Parameters:
effectiveUser
- The user for whom strategy access should be checked- Returns:
- An array of String of strategy names
-
getUsersForGroup
Get the users that are members of a group- Parameters:
group
- The String name of the group to find users for- Returns:
- A String array of users with membership in this group
-
changePassword
Changes the password of a user entry in passwd- Specified by:
changePassword
in interfaceDbAclWriter
- Parameters:
user
- The user for which the password should be updatedpasswordHash
- The new password value to store- Throws:
SQLException
- In the case of SQL implementations of this interface if something goes wrong
-
getSystemUsers
Returns an array of systemusers.- Returns:
- A String array of distinct systemuser names, sorted.
-
getPasswdsForMigration
Returns user and password entries from the passwd table. Intended for use during ACL exports and/or data migration between MySQL and Etcd ACL stores.- Returns:
- A
List
ofPair<String,String>
objects which contain a user and password entry.
-
getRunAsUserMap
Returns a map of user names to systemuser names- Returns:
- a map of user names to systemuser names
-
getRunAsUser
Returns the systemuser to which the effectiveUser is mapped, or null if no mapping exists.- Parameters:
effectiveUser
- The user for which a mapped systemuser name should be retrieved.- Returns:
- the String systemuser to which the effectiveUser is mapped, or null if no mapping exists.
-
close
void close()
-