Acl::Groups
Inherits YAML::Serializable / Lockable / Reference / Object
The Groups is used to handle a set of uniq Group, by name.
Constructors
new(ctx : YAML::ParseContext, node : YAML::Nodes::Node)
Sourcenew(file : String)
acls = Acl::Groups.new
g1 = Acl::Group.new(name: "user", default: Acl::Perm::Read, permissions: {"/tmp/protected" => Acl::Perm::None})
g2 = Acl::Group.new(name: "admin", default: Acl::Perm::Write)
acls.add g1
acls.add g2
new(*, __context_for_yaml_serializable ctx : YAML::ParseContext, __node_for_yaml_serializable node : YAML::Nodes::Node)
SourceClass methods
read(file : String)
SourceInstance methods
add(group : String)
Sourceadd(group : Acl::Group)
Sourceclear_permissions_of(path : String)
Sourcedelete(group : String)
Sourcedelete(group : Acl::Group)
Sourcefile
Sourcefile=(file : String)
Sourcegroup_exists?(group : String) : Bool
Sourcegroup_exists?(group : Acl::Groum) : Bool
Sourcegroups
Sourcegroups_having_any_access_to(path : String, acl_min : Acl::Perm, not_more : Bool = false) : Array(String)
Sourcegroups_having_direct_access_to(path : String, acl_min : Acl::Perm, not_more : Bool = false) : Array(String)
List the groups having at least the permission acl_min on a path
Check if an Entity has a group with the required permissions to operate.
acls = Groups.new...user = User.new...acls.permitted?(user, "/my/path", Perm::Read)
save!
Source