Interface PermissionManager


  • public interface PermissionManager
    API for managing permissions in Stardog
    Since:
    0.9
    Version:
    3.1
    Author:
    Blazej Bulka, Michael Grove
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void addRolePerm​(com.complexible.stardog.security.Permission thePermission)
      Grants a permission to a role.
      void addUserPerm​(com.complexible.stardog.security.Permission thePermission)
      Grants a permission to a user.
      void deleteRolePerm​(com.complexible.stardog.security.Permission thePermission)
      Revokes a permission from a role.
      void deleteUserPerm​(com.complexible.stardog.security.Permission thePermission)
      Revokes a permission from a user.
      java.util.Collection<com.complexible.stardog.security.Permission> getEffectiveUserPerms​(java.lang.String theUsername)
      Return the effective permissions, explicit and inferred, for the specified user
      java.util.Collection<com.complexible.stardog.security.Permission> getRolePerms​(java.lang.String theRole)
      Return the permissions associated with the specified role
      java.util.Collection<com.complexible.stardog.security.Permission> getUserPerms​(java.lang.String theUsername)
      Gets the current user permissions (explicit only)
      java.util.regex.Pattern getValidResourceNamePattern()
      Return the regex pattern used to validate resource names
    • Method Detail

      • addRolePerm

        void addRolePerm​(com.complexible.stardog.security.Permission thePermission)
                  throws com.complexible.stardog.security.StardogSecurityException,
                         com.complexible.stardog.security.ResourceNotFoundException,
                         com.complexible.stardog.security.ResourceExistsException,
                         StardogAuthorizationException
        Grants a permission to a role.
        Parameters:
        thePermission - the permission to grant
        Throws:
        com.complexible.stardog.security.ResourceNotFoundException - if the resource referenced in the operation does not exist
        com.complexible.stardog.security.ResourceExistsException - if there is already such a permission for this role
        StardogAuthorizationException - if the current user is not authorized to grant the permission
        com.complexible.stardog.security.StardogSecurityException - if the operation should fail for any other reason
      • deleteRolePerm

        void deleteRolePerm​(com.complexible.stardog.security.Permission thePermission)
                     throws com.complexible.stardog.security.StardogSecurityException,
                            com.complexible.stardog.security.ResourceNotFoundException,
                            StardogAuthorizationException
        Revokes a permission from a role.
        Parameters:
        thePermission - the permission to revoke
        Throws:
        com.complexible.stardog.security.ResourceNotFoundException - if the resource referenced in the operation does not exist or the role does not have the permission
        StardogAuthorizationException - if the current user is not authorized to revoke the permission
        com.complexible.stardog.security.StardogSecurityException - if the operation should fail for any other reason
      • addUserPerm

        void addUserPerm​(com.complexible.stardog.security.Permission thePermission)
                  throws com.complexible.stardog.security.StardogSecurityException,
                         com.complexible.stardog.security.ResourceNotFoundException,
                         com.complexible.stardog.security.ResourceExistsException,
                         StardogAuthorizationException
        Grants a permission to a user.
        Parameters:
        thePermission - the permission to grant
        Throws:
        com.complexible.stardog.security.ResourceNotFoundException - if the resource referenced in the operation does not exist
        com.complexible.stardog.security.ResourceExistsException - if there is already such a permission for this user
        StardogAuthorizationException - if the current user is not authorized to grant the permission
        com.complexible.stardog.security.StardogSecurityException - if the operation should fail for any other reason
      • deleteUserPerm

        void deleteUserPerm​(com.complexible.stardog.security.Permission thePermission)
                     throws com.complexible.stardog.security.StardogSecurityException,
                            com.complexible.stardog.security.ResourceNotFoundException,
                            StardogAuthorizationException
        Revokes a permission from a user.
        Parameters:
        thePermission - the permission to revoke
        Throws:
        com.complexible.stardog.security.ResourceNotFoundException - if the resource referenced in the operation does not exist (or the user does not have the permission to be revoked)
        StardogAuthorizationException - if the current user is not authorized to revoke the permission
        com.complexible.stardog.security.StardogSecurityException - if the operation should fail for any other reason
      • getUserPerms

        java.util.Collection<com.complexible.stardog.security.Permission> getUserPerms​(java.lang.String theUsername)
                                                                                throws com.complexible.stardog.security.StardogSecurityException,
                                                                                       com.complexible.stardog.security.ResourceNotFoundException,
                                                                                       StardogAuthorizationException
        Gets the current user permissions (explicit only)
        Parameters:
        theUsername - the user name whose permissions should be retrieved
        Returns:
        a collection of string representations of permissions
        Throws:
        com.complexible.stardog.security.ResourceNotFoundException - if there is no user with the specified name
        StardogAuthorizationException - if the current user does not have a permission to retrieve the permission information for the specified user
        com.complexible.stardog.security.StardogSecurityException - if the operation should fail for any other reason
      • getEffectiveUserPerms

        java.util.Collection<com.complexible.stardog.security.Permission> getEffectiveUserPerms​(java.lang.String theUsername)
                                                                                         throws com.complexible.stardog.security.StardogSecurityException,
                                                                                                com.complexible.stardog.security.ResourceNotFoundException,
                                                                                                StardogAuthorizationException
        Return the effective permissions, explicit and inferred, for the specified user
        Parameters:
        theUsername - the user
        Returns:
        the effective permissions of the user
        Throws:
        com.complexible.stardog.security.StardogSecurityException - if the operation should fail for any other reason
        com.complexible.stardog.security.ResourceNotFoundException - if the user is not found
        StardogAuthorizationException - if the current user cannot perform this operation
      • getRolePerms

        java.util.Collection<com.complexible.stardog.security.Permission> getRolePerms​(java.lang.String theRole)
                                                                                throws com.complexible.stardog.security.StardogSecurityException,
                                                                                       com.complexible.stardog.security.ResourceNotFoundException,
                                                                                       StardogAuthorizationException
        Return the permissions associated with the specified role
        Parameters:
        theRole - the name of the role
        Returns:
        the permissions for the role
        Throws:
        com.complexible.stardog.security.StardogSecurityException - if the operation should fail for any other reason
        com.complexible.stardog.security.ResourceNotFoundException - if the role is not found
        StardogAuthorizationException - if the current user cannot perform the operation
      • getValidResourceNamePattern

        java.util.regex.Pattern getValidResourceNamePattern()
                                                     throws com.complexible.stardog.security.StardogSecurityException
        Return the regex pattern used to validate resource names
        Throws:
        com.complexible.stardog.security.StardogSecurityException