Class UpdateUserPermission

  • All Implemented Interfaces:
    BasePermission<User>

    @Component
    public class UpdateUserPermission
    extends RepositoryBackedPermission<User,​java.lang.Long>
    Confirms that the authenticated user is allowed to modify another (or their own) user account.
    • Constructor Detail

      • UpdateUserPermission

        @Autowired
        public UpdateUserPermission​(UserRepository userRepository)
        Construct an instance of UpdateUserPermission.
        Parameters:
        userRepository - the user repository.
    • Method Detail

      • customPermissionAllowed

        public boolean customPermissionAllowed​(org.springframework.security.core.Authentication authentication,
                                               User u)
        This method is called by RepositoryBackedPermission to evaluate the custom permissions provided by implementing classes.
        Specified by:
        customPermissionAllowed in class RepositoryBackedPermission<User,​java.lang.Long>
        Parameters:
        authentication - the authenticated user.
        u - the object that the user is attempting to access.
        Returns:
        true if permitted, false otherwise.
      • 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.