Marmot Manual

Chapter 3. Authorization Services

Table of Contents

Using authorization services

Once your application has verified a user's credentials (authentication), it may need to determine what the user is allowed to do (authorization). Marmot provides authorization services that your application can use.

Authorization services are provided by the MU_Authorize class. To check authorizations, you need only create a new object of this class and call the appropriate check method.

Using authorization services

An object of the MU_Authorize class must be instanciated with either a username or an LDAP DN as a parameter:

$auth = new MU_Authorize('publicjq');

This username or DN is then used to perform any required authorizations.

Three types of authorization are supported:

  • Attribute comparison (LDAP)

  • Group membership - Miami University only (Novell eDirectory)

  • Explicitly granted - Miami University only (Authorization Manager)

Attribute comparison

Every LDAP user object has a variety of attributes, such as title, department, or classification. These attributes can be used to authorize a user to access certain features of the application. Attribute checking is done using the check_attribute method:

$auth->check_attribute($attribute, $value); $auth->check_attribute('eduPersonAffiliation', 'staff');

This method returns true if matched, false if failed, and -1 on error.

Group Membership - Miami University only

Miami University mantains various groups in its Novell eDirectory and membership in those groups can be used as a basis for authorization. (Miami maintains two different directory services. At most institutions, one would just use the check_attribute method to check group membership.) Group checking is done using the check_group method:

$auth->check_group($group_dn); $auth->check_group('cn=Network Applications Group,ou=MCS,o=MU');

This method returns true if matched, false if failed, and -1 on error.

Explicitly granted - Miami University only

Miami University has created a central authorization management application in order to better administer the diverse authorizations made to clients. The authorization manager is still in development and more information will be forthcoming. The authorization manager can be checked using the check_authorization method:

$auth->check_attribute($application, $module, $key); $auth->check_attribute('my_application', 'user_management', 'add_user')

This method returns true if matched, false if failed, and -1 on error.