ballerina.auth.authz.permissionstore package

public struct FileBasedPermissionStore

Represents the permission store

  • < FileBasedPermissionStore > isAuthorized ( string username , string scopeName ) ( boolean )

    Checks if the the user has sufficient permission to access a resource with the specified scope

    Parameter Name Data Type Description
    username string user name
    scopeName string name of the scope

    Return Variable Data Type Description
    boolean boolean: true if authorized, else false
  • < FileBasedPermissionStore > readGroupsOfScope ( string scopeName ) ( string )

    Reads groups for the given scopes

    Parameter Name Data Type Description
    scopeName string name of the scope

    Return Variable Data Type Description
    string string: comma separated groups specified for the scopename
  • < FileBasedPermissionStore > readGroupsOfUser ( string username ) ( string )

    Reads the groups for a user

    Parameter Name Data Type Description
    username string

    Return Variable Data Type Description
    string string: comma separeted groups list, as specified in the userstore file

public struct PermissionStore

Represents the permission store. Any implementation of the Permission store should be struct-wise similar

  • < PermissionStore > isAuthorized ( string username , string scopeName ) ( boolean )

    Checks if the the user has sufficient permission to access a resource with the specified scope

    Parameter Name Data Type Description
    username string user name
    scopeName string name of the scope

    Return Variable Data Type Description
    boolean boolean: true if authorized, else false
  • < PermissionStore > readGroupsOfScope ( string scopeName ) ( string )

    Reads groups for the given scopes

    Parameter Name Data Type Description
    scopeName string name of the scope

    Return Variable Data Type Description
    string string: comma separated groups specified for the scopename
  • < PermissionStore > readGroupsOfUser ( string username ) ( string )

    Reads the groups for a user

    Parameter Name Data Type Description
    username string

    Return Variable Data Type Description
    string string: comma separeted groups list, as specified in the userstore file