Class ProjectOwnerPermission
- java.lang.Object
-
- ca.corefacility.bioinformatics.irida.security.permissions.RepositoryBackedPermission<Project,java.lang.Long>
-
- ca.corefacility.bioinformatics.irida.security.permissions.project.ModifyProjectPermission
-
- ca.corefacility.bioinformatics.irida.security.permissions.project.ProjectOwnerPermission
-
- All Implemented Interfaces:
BasePermission<Project>
@Component public class ProjectOwnerPermission extends ModifyProjectPermission
Confirms that a given user is the owner of a project
-
-
Constructor Summary
Constructors Constructor Description ProjectOwnerPermission(ProjectRepository projectRepository, UserRepository userRepository, ProjectUserJoinRepository pujRepository, UserGroupProjectJoinRepository ugpjRepository)
Construct an instance ofProjectOwnerPermission
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
adminAccessAllowed(org.springframework.security.core.Authentication authentication, java.lang.Object targetDomainObject)
Check whether admins should be quick-approved for this permission.boolean
canUpdateRemoteObject(java.lang.Object object, org.springframework.security.core.Authentication authentication)
Check if the given object is a remote object, and if so if the authentication is aProjectSynchronizationAuthenticationToken
objectboolean
customPermissionAllowed(org.springframework.security.core.Authentication authentication, Project p)
This method is called byRepositoryBackedPermission
to evaluate the custom permissions provided by implementing classes.java.lang.String
getPermissionProvided()
Get the implementation-specific permission provided.-
Methods inherited from class ca.corefacility.bioinformatics.irida.security.permissions.RepositoryBackedPermission
isAllowed
-
-
-
-
Constructor Detail
-
ProjectOwnerPermission
@Autowired public ProjectOwnerPermission(ProjectRepository projectRepository, UserRepository userRepository, ProjectUserJoinRepository pujRepository, UserGroupProjectJoinRepository ugpjRepository)
Construct an instance ofProjectOwnerPermission
.- Parameters:
projectRepository
- the project repository.userRepository
- the user repository.pujRepository
- the project user join repository.ugpjRepository
- The user group project join repository.
-
-
Method Detail
-
customPermissionAllowed
public boolean customPermissionAllowed(org.springframework.security.core.Authentication authentication, Project p)
This method is called byRepositoryBackedPermission
to evaluate the custom permissions provided by implementing classes.- Overrides:
customPermissionAllowed
in classModifyProjectPermission
- Parameters:
authentication
- the authenticated user.p
- the object that the user is attempting to access.- Returns:
- true if permitted, false otherwise.
-
adminAccessAllowed
protected boolean adminAccessAllowed(org.springframework.security.core.Authentication authentication, java.lang.Object targetDomainObject)
Check whether admins should be quick-approved for this permission. This may be overridden for special cases- Overrides:
adminAccessAllowed
in classRepositoryBackedPermission<Project,java.lang.Long>
- Parameters:
authentication
- The authentication of the logged in usertargetDomainObject
- the object that is being acted on- Returns:
- true of the admin should be approved
-
getPermissionProvided
public java.lang.String getPermissionProvided()
Description copied from interface:BasePermission
Get the implementation-specific permission provided.- Returns:
- the permission provided by the permission class.
-
canUpdateRemoteObject
public boolean canUpdateRemoteObject(java.lang.Object object, org.springframework.security.core.Authentication authentication)
Check if the given object is a remote object, and if so if the authentication is aProjectSynchronizationAuthenticationToken
object- Parameters:
object
- the object to testauthentication
- the authentication to test- Returns:
- true if either the object is not remote, or if it is remote and
the authentication is a
ProjectSynchronizationAuthenticationToken
-
-