struct DppmRestApi::Config::Group

Overview

A group represents an access role that a user may be a member of.

Included Modules

Defined in:

config/group.cr

Constant Summary

DEFAULT_PERMISSIONS = {"/**" => Route.new(Access.deny), "/user/me" => Route.new(Access::Read), "/{app,pkg,src,service}/**" => Route.new(Access::All, {"namespace" => ["default-namespace"]})}

Constructors

Instance Method Summary

Constructor Detail

def self.new(name, id, permissions) #

[View source]
def self.new(pull : JSON::PullParser) #

[View source]
def self.new(name) #

[View source]

Instance Method Detail

def can_access?(path : String, query : HTTP::Params, requested_permissions : Access) : Bool #

returns true if members of this group may access a request on the given route, with the given permission level.


[View source]
def id : Int32 #

The identifier used to refer to this Group. This must be unique.


[View source]
def id=(id : Int32) #

The identifier used to refer to this Group. This must be unique.


[View source]
def name : String #

The human-readable name of the Group. This should be unique.


[View source]
def name=(name : String) #

The human-readable name of the Group. This should be unique.


[View source]
def permissions : Hash(String, Route) #

All route-matching globs associated with this Group, mapped to the group's permission level.


[View source]
def permissions=(permissions : Hash(String, Route)) #

All route-matching globs associated with this Group, mapped to the group's permission level.


[View source]