Group
NAME
Object::Permission::Group - Object helper for Object::Permission using unix groups.
SYNOPSIS
use Object::Permission::Group; # $*AUTH-USER is derived from $*USER
# Or:
Use Object::Permission::Group;
# Set $*AUTH-USER to one for a specified user
$*AUTH-USER = Object::Permission::Group.new(user => 'wibble');
DESCRIPTION
This provides a simple implementation
of Object::Permission::User to be used with
Object::Permission
which derives the permissions for the $*AUTH-USER
from the users unix
group membership.
By default $*AUTH-USER
is initialised based on the value of $*USER
(i.e. the effective user,) but it can be set manually with the permissions
of an arbitrary user (as in the second example above.)
The $*AUTH-USER
is set in the dynamic scope that the module is use
d
in. However this can be over-ridden with the scoping as described in
Dynamic Variables.
METHODS
This doesn't really have any methods, just a constructor and the accessor
for permissions
defined in Object::Permission::User.
method new
method new(:$!user = $*USER.Str)
The constructor for the class. By default the :$!user
argument is set
to the login of the effective user, but can be the name of any existing
user on the system. If the user doesn't exist no permissions will be set.
The permissions are derived in the constructor from the names of the groups that user is a member of, it is of course possible to append new permissions at run time if that is required.