class Acl::Groups
- Acl::Groups
- Lockable
- Reference
- Object
Overview
The Groups is used to handle a set of uniq Group
, by name.
Included Modules
- YAML::Serializable
Defined in:
lib/acl/groups.crConstructors
Class Method Summary
Instance Method Summary
- #[](group : String) : Acl::Group
- #[](group : Acl::Group) : Acl::Group
- #[]?(group : String) : Acl::Group | Nil
- #[]?(group : Acl::Group) : Acl::Group | Nil
- #add(group : String)
- #add(group : Acl::Group)
- #add_permissions_to(path : String, groups : Array(String), acl : Acl::Perm)
- #clear_permissions_of(path : String, acl : Acl::Perm)
- #clear_permissions_of(path : String)
- #delete(group : String)
- #delete(group : Acl::Group)
- #file : String
- #file=(file : String)
- #group_exists?(group : String) : Bool
- #group_exists?(group : Acl::Groum) : Bool
- #groups : Hash(String, Acl::Group)
- #groups=(groups : Hash(String, Acl::Group))
- #groups_having_any_access_to(path : String, acl_min : Acl::Perm, not_more : Bool = false) : Array(String)
-
#groups_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
-
#load!
Read the file and erase the content, skip if the file does not exists
-
#permitted?(entity : Acl::Entity, path : String, access : Acl::Perm)
Check if an
Entity
has a group with the required permissions to operate. - #save!
Instance methods inherited from class Lockable
load!
load!,
save!
save!,
transaction!(read = false, &)
transaction!
Constructor Detail
def self.new(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
Class Method Detail
Instance Method Detail
def groups_having_any_access_to(path : String, acl_min : Acl::Perm, not_more : Bool = false) : Array(String)
#
def groups_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)