public interface BaseSecurity
限定符和类型 | 方法和说明 |
---|---|
void |
addIdentityToSecurityGroup(Identity identity,
SecurityGroup secGroup) |
int |
countIdentitiesOfSecurityGroup(SecurityGroup secGroup) |
java.lang.Long |
countUniqueUserLoginsSince(java.util.Date lastLoginLimit)
get number of users with last login greater than lastLoginLimit
|
Authentication |
createAndPersistAuthentication(Identity identity,
java.lang.String provider,
java.lang.String authUsername,
java.lang.String credential) |
Identity |
createAndPersistIdentity(java.lang.String username,
User user,
java.lang.String provider,
java.lang.String authusername,
java.lang.String credential) |
Identity |
createAndPersistIdentityAndUser(java.lang.String username,
User user,
java.lang.String provider,
java.lang.String authusername,
java.lang.String credential) |
Identity |
createAndPersistIdentityAndUserWithUserGroup(java.lang.String loginName,
java.lang.String pwd,
User newUser)
Persists the given user, creates an identity for it and adds the user to the users system group
|
SecurityGroup |
createAndPersistNamedSecurityGroup(java.lang.String groupName)
create only makes no sense, since there are no attibutes to set
|
Policy |
createAndPersistPolicy(SecurityGroup secGroup,
java.lang.String permission,
java.util.Date from,
java.util.Date to,
OLATResourceable olatResourceable) |
Policy |
createAndPersistPolicy(SecurityGroup secGroup,
java.lang.String permission,
OLATResourceable olatResourceable)
the olatResourceable is not required to have some persisted implementation, but the manager will use the OLATResource to persist it.
|
Policy |
createAndPersistPolicyWithResource(SecurityGroup secGroup,
java.lang.String permission,
java.util.Date from,
java.util.Date to,
OLATResource olatResource) |
Policy |
createAndPersistPolicyWithResource(SecurityGroup secGroup,
java.lang.String permission,
OLATResource olatResource)
Creates and persist a policy for certain OLAT-resource (instead of OLAT-resourceable)
|
SecurityGroup |
createAndPersistSecurityGroup()
create only makes no sense, since there are no attibutes to set
|
void |
deleteAuthentication(Authentication authentication) |
void |
deleteInvitation(Invitation invitation)
Delete an invitation
|
void |
deleteNamedGroup(java.lang.String string)
已过时。
|
void |
deletePolicy(SecurityGroup secGroup,
java.lang.String permission,
OLATResourceable olatResourceable) |
void |
deleteSecurityGroup(SecurityGroup secGroup)
removes the group with all the idendities contained in it, the idenities itself are of course not deleted.
|
Authentication |
findAuthentication(Identity identity,
java.lang.String provider) |
Authentication |
findAuthenticationByAuthusername(java.lang.String authusername,
java.lang.String provider) |
java.util.List<Invitation> |
findExpiredInvitations(java.util.Date limitDate)
Retrieves all expired invitations created earlier than
limitDate |
Identity |
findIdentityByName(java.lang.String identityName)
Find an identity by its name.
|
Invitation |
findInvitation(SecurityGroup secGroup)
Find an invitation by its security group
|
Invitation |
findInvitation(java.lang.String token)
Find an invitation by its security token
|
SecurityGroup |
findSecurityGroupByName(java.lang.String securityGroupName) |
java.util.List<java.lang.Long> |
getActiveIdentityIds() |
java.util.List<Authentication> |
getAuthentications(Identity identity)
Return the List of associated Authentications.
|
java.util.List<Identity> |
getDeletedIdentitiesByName(java.lang.String identityName)
已过时。
|
java.util.List<SecurityGroup> |
getGroupsWithPermissionOnOlatResourceable(java.lang.String permission,
OLATResourceable olatResourceable)
use for testing ONLY.
|
java.util.List<java.lang.Object[]> |
getIdentitiesAndDateOfSecurityGroup(SecurityGroup secGroup) |
java.util.List<java.lang.Object[]> |
getIdentitiesAndDateOfSecurityGroup(SecurityGroup secGroup,
boolean sortedByAddDate) |
java.util.List<Identity> |
getIdentitiesByPowerSearch(java.lang.String login,
java.util.Map<java.lang.String,java.lang.String> userProperties,
boolean userPropertiesAsIntersectionSearch,
SecurityGroup[] groups,
PermissionOnResourceable[] permissionOnResources,
java.lang.String[] authProviders,
java.util.Date createdAfter,
java.util.Date createdBefore,
java.util.Date userLoginAfter,
java.util.Date userLoginBefore,
java.lang.Integer status)
Get a list of identities that match the following conditions.
|
java.util.List<Identity> |
getIdentitiesOfSecurityGroup(SecurityGroup secGroup) |
java.util.List<Identity> |
getIdentitiesOfSecurityGroup(SecurityGroup secGroup,
boolean sortedByAddDate) |
java.util.List<Identity> |
getIdentitiesWithPermissionOnOlatResourceable(java.lang.String permission,
OLATResourceable olatResourceable)
use for testing ONLY.
|
java.util.List<Identity> |
getPoliciesOfIdentity(Identity identity)
for debugging and info by the olat admins:
|
java.util.List<Policy> |
getPoliciesOfResource(OLATResourceable resource,
SecurityGroup securityGroup)
Return the policies
|
java.util.List<Policy> |
getPoliciesOfSecurityGroup(SecurityGroup secGroup) |
Roles |
getRoles(Identity identity)
Get the identity's roles
|
java.util.Date |
getSecurityGroupJoinDateForIdentity(SecurityGroup secGroup,
Identity identity)
Get date where identity joined a security group
|
java.util.List<SecurityGroup> |
getSecurityGroupsForIdentity(Identity identity)
Get all SecurtityGroups an Identity is in
|
java.util.List<Identity> |
getVisibleIdentitiesByPowerSearch(java.lang.String login,
java.util.Map<java.lang.String,java.lang.String> userProperties,
boolean userPropertiesAsIntersectionSearch,
SecurityGroup[] groups,
PermissionOnResourceable[] permissionOnResources,
java.lang.String[] authProviders,
java.util.Date createdAfter,
java.util.Date createdBefore)
Get a list of identities that match the following conditions.
|
boolean |
hasInvitationPolicies(java.lang.String token,
java.util.Date atDate)
Is the invitation linked to any valid policies
|
void |
init() |
boolean |
isIdentityInSecurityGroup(Identity identity,
SecurityGroup secGroup)
use only if really needed.
|
boolean |
isIdentityInvited(Identity identity)
Check if the identity has an invitation, valid or not
|
boolean |
isIdentityPermittedOnResourceable(Identity identity,
java.lang.String permission,
OLATResourceable olatResourceable)
is allowed to....
|
boolean |
isIdentityPermittedOnResourceable(Identity identity,
java.lang.String permission,
OLATResourceable olatResourceable,
boolean checkTypeRight) |
boolean |
isIdentityVisible(java.lang.String identityName)
Check if identity is visible.
|
Identity |
loadIdentityByKey(java.lang.Long identityKey)
find an identity by the key instead of the username.
|
Identity |
loadIdentityByKey(java.lang.Long identityKey,
boolean strict)
find an identity by the key or return null if no identity found
|
void |
removeIdentityFromSecurityGroup(Identity identity,
SecurityGroup secGroup)
Removes the identity from this security group or does nothing if the identity is not in the group at all.
|
void |
saveIdentityStatus(Identity identity,
java.lang.Integer status)
Save an identity
|
Invitation |
saveInvitation(Invitation invitation)
Create and persist an invitation with its security group and security token.
|
void |
updateInvitation(Invitation invitation)
Update the invitation
|
void |
updatePolicy(Policy policy,
java.util.Date from,
java.util.Date to)
Update the policy valid dates
|
void init()
boolean isIdentityPermittedOnResourceable(Identity identity, java.lang.String permission, OLATResourceable olatResourceable)
identity
- permission
- olatResourceable
- Roles getRoles(Identity identity)
identity
- boolean isIdentityPermittedOnResourceable(Identity identity, java.lang.String permission, OLATResourceable olatResourceable, boolean checkTypeRight)
identity
- permission
- olatResourceable
- checkTypeRight
- boolean isIdentityInSecurityGroup(Identity identity, SecurityGroup secGroup)
identity
- secGroup
- java.util.List<Identity> getIdentitiesOfSecurityGroup(SecurityGroup secGroup)
secGroup
- java.util.List<Identity> getIdentitiesOfSecurityGroup(SecurityGroup secGroup, boolean sortedByAddDate)
secGroup
- java.util.List<java.lang.Object[]> getIdentitiesAndDateOfSecurityGroup(SecurityGroup secGroup)
secGroup
- java.util.List<java.lang.Object[]> getIdentitiesAndDateOfSecurityGroup(SecurityGroup secGroup, boolean sortedByAddDate)
sortedByAddDate
- true= return list of idenities sorted by added datejava.util.Date getSecurityGroupJoinDateForIdentity(SecurityGroup secGroup, Identity identity)
secGroup
- identity
- SecurityGroup findSecurityGroupByName(java.lang.String securityGroupName)
securityGroupName
- void deleteNamedGroup(java.lang.String string)
Identity findIdentityByName(java.lang.String identityName)
Be aware that this method does not check the identities status! This method returns identities with any state, also deleted identities!
identityName
- java.util.List<Identity> getDeletedIdentitiesByName(java.lang.String identityName)
Identity loadIdentityByKey(java.lang.Long identityKey)
identityKey
- the key of the identity to load; may not be null or zeroIdentity loadIdentityByKey(java.lang.Long identityKey, boolean strict)
identityKey
- the key of the identity to load; may not be null or zerojava.lang.Long countUniqueUserLoginsSince(java.util.Date lastLoginLimit)
lastLoginLimit
- int countIdentitiesOfSecurityGroup(SecurityGroup secGroup)
secGroup
- Identity createAndPersistIdentity(java.lang.String username, User user, java.lang.String provider, java.lang.String authusername, java.lang.String credential)
username
- the usernameuser
- the unpresisted Userprovider
- the provider of the authentication ("OLAT" or "AAI"). If null, no authentication token is generated.authusername
- the username used as authentication credential (=username for provider "OLAT")credential
- the credentials or null if not usedIdentity createAndPersistIdentityAndUser(java.lang.String username, User user, java.lang.String provider, java.lang.String authusername, java.lang.String credential)
username
- the usernameuser
- the unpresisted Userprovider
- the provider of the authentication ("OLAT" or "AAI"). If null, no authentication token is generated.authusername
- the username used as authentication credential (=username for provider "OLAT")credential
- the credentials or null if not usedIdentity createAndPersistIdentityAndUserWithUserGroup(java.lang.String loginName, java.lang.String pwd, User newUser)
loginName
- pwd
- null: no OLAT authentication is generated. If not null, the password will be encrypted and and an OLAT authentication is generated.newUser
- unpersisted usersjava.util.List<Authentication> getAuthentications(Identity identity)
identity
- Authentication findAuthentication(Identity identity, java.lang.String provider)
identity
- provider
- Authentication createAndPersistAuthentication(Identity identity, java.lang.String provider, java.lang.String authUsername, java.lang.String credential)
identity
- provider
- authUsername
- credential
- void deleteAuthentication(Authentication authentication)
authentication
- SecurityGroup createAndPersistSecurityGroup()
SecurityGroup createAndPersistNamedSecurityGroup(java.lang.String groupName)
groupName
- void deleteSecurityGroup(SecurityGroup secGroup)
secGroup
- void addIdentityToSecurityGroup(Identity identity, SecurityGroup secGroup)
identity
- secGroup
- void removeIdentityFromSecurityGroup(Identity identity, SecurityGroup secGroup)
identity
- secGroup
- Policy createAndPersistPolicy(SecurityGroup secGroup, java.lang.String permission, OLATResourceable olatResourceable)
secGroup
- permission
- olatResourceable
- Policy createAndPersistPolicy(SecurityGroup secGroup, java.lang.String permission, java.util.Date from, java.util.Date to, OLATResourceable olatResourceable)
Policy createAndPersistPolicyWithResource(SecurityGroup secGroup, java.lang.String permission, OLATResource olatResource)
secGroup
- permission
- olatResource
- Policy createAndPersistPolicyWithResource(SecurityGroup secGroup, java.lang.String permission, java.util.Date from, java.util.Date to, OLATResource olatResource)
Invitation saveInvitation(Invitation invitation)
void updateInvitation(Invitation invitation)
invitation
- boolean hasInvitationPolicies(java.lang.String token, java.util.Date atDate)
token
- atDate
- Invitation findInvitation(SecurityGroup secGroup)
secGroup
- Invitation findInvitation(java.lang.String token)
token
- boolean isIdentityInvited(Identity identity)
identity
- void deleteInvitation(Invitation invitation)
invitation
- java.util.List<Invitation> findExpiredInvitations(java.util.Date limitDate)
limitDate
void deletePolicy(SecurityGroup secGroup, java.lang.String permission, OLATResourceable olatResourceable)
secGroup
- permission
- olatResourceable
- java.util.List<Policy> getPoliciesOfSecurityGroup(SecurityGroup secGroup)
secGroup
- java.util.List<Policy> getPoliciesOfResource(OLATResourceable resource, SecurityGroup securityGroup)
resource
- The resource (mandatory)securityGroup
- The securityGroup (optional)void updatePolicy(Policy policy, java.util.Date from, java.util.Date to)
policy
- from
- to
- java.util.List<SecurityGroup> getGroupsWithPermissionOnOlatResourceable(java.lang.String permission, OLATResourceable olatResourceable)
permission
- olatResourceable
- java.util.List<Identity> getIdentitiesWithPermissionOnOlatResourceable(java.lang.String permission, OLATResourceable olatResourceable)
permission
- olatResourceable
- java.util.List<Identity> getPoliciesOfIdentity(Identity identity)
identity
- Authentication findAuthenticationByAuthusername(java.lang.String authusername, java.lang.String provider)
authusername
- provider
- java.util.List<Identity> getVisibleIdentitiesByPowerSearch(java.lang.String login, java.util.Map<java.lang.String,java.lang.String> userProperties, boolean userPropertiesAsIntersectionSearch, SecurityGroup[] groups, PermissionOnResourceable[] permissionOnResources, java.lang.String[] authProviders, java.util.Date createdAfter, java.util.Date createdBefore)
login
- userPropertyHandlers
- Map of user properties that needs to be matched.userPropertiesAsIntersectionSearch
- true: user properties and login name are combined with an AND query; false: user properties and login name are combined with an OR querygroups
- Array of SecurityGroups the user participates in. Search machtches if user is in any of the groups (OR query)permissionOnResources
- Array of resource permissions the user has. Search machtches if user has any of the permissions (OR query)authProviders
- Array of authenticaton providers the user has. Search machtches if user has any of the authProviders (OR query)createdAfter
- date after which the user has been createdcreatedBefore
- date before which the user has been createdjava.util.List<Identity> getIdentitiesByPowerSearch(java.lang.String login, java.util.Map<java.lang.String,java.lang.String> userProperties, boolean userPropertiesAsIntersectionSearch, SecurityGroup[] groups, PermissionOnResourceable[] permissionOnResources, java.lang.String[] authProviders, java.util.Date createdAfter, java.util.Date createdBefore, java.util.Date userLoginAfter, java.util.Date userLoginBefore, java.lang.Integer status)
login
- userPropertyHandlers
- Map of user properties that needs to be matched.userPropertiesAsIntersectionSearch
- true: user properties and login name are combined with an AND query; false: user properties and login name are combined with an OR querygroups
- Array of SecurityGroups the user participates in. Search machtches if user is in any of the groups (OR query)permissionOnResources
- Array of resource permissions the user has. Search machtches if user has any of the permissions (OR query)authProviders
- Array of authenticaton providers the user has. Search machtches if user has any of the authProviders (OR query)createdAfter
- date after which the user has been createdcreatedBefore
- date before which the user has been createduserLoginBefore
- date before the user has logged in the last timeuserLoginAfter
- date after the user has logged in the last timestatus
- identity status, define in interface Identity e.g. ACTIV, LOGIN_DENIED, DELETEDjava.util.List<java.lang.Long> getActiveIdentityIds()
void saveIdentityStatus(Identity identity, java.lang.Integer status)
identity
- Save this identityboolean isIdentityVisible(java.lang.String identityName)
identityName
- java.util.List<SecurityGroup> getSecurityGroupsForIdentity(Identity identity)
identity
-