Authorization.AbstractClient
— TypeRequired fields:
- id::String;
- id2permission::Dict{String, Permission}; # Resource ID => Permission
- idpattern2permission::Dict{Regex, Permission}; # Resource ID pattern => Permission
- type2permission::Dict{DataType, Permission}; # Resource type => Permission
Authorization.AbstractResource
— TypeRequired fields:
- id::String
Authorization.create!
— MethodCreate resource. If successful return nothing, else return an error message as a String.
Authorization.getpermission
— MethodReturns the Permission object for client-resource combination if it exists, else returns nothing.
Authorization.haspermission
— MethodReturns true if the client has permission to act on the resource according to the given action.
Action ust be one of :create, :read, :update, :delete.
Authorization.setexpiry!
— MethodSet the expiry of every permission of the client to the given expiry.
Authorization.update!
— MethodUpdate resource. If successful return nothing, else return an error message as a String.
Base.delete!
— MethodDelete resource. If successful return nothing, else return an error message as a String.
Base.read
— MethodRead resource. If successful return (true, value), else return (false, errormessage::String).
Authorization.permisssions_conflict
— MethodReturns true if more than one resource ID pattern matches the resource ID.