Jeff PHP framework  0.99
Modular, extensible, OOP, MVC, lightweight php framework designed to ease the programmers in the development of web applications.

Class used to check the user privileges. More...

Static Public Member Functions

static check ($class=null, $pids=null, $opts=null)
 Checks if the user has the right privileges to acess the requested content.
static hasGroup ($group_ids)
 Checks if the user belongs to at least one of the given groups.

Detailed Description

Class used to check the user privileges.

Provides methods to check if the user may access the desired content.

Jeff privileges are defined by a 'class' and an 'identifier'. So each class may use as many privileges as needed, each one with a different identifier. All the available privileges are stores in the database table sys_privileges. Since in many cases it's enough to deal with generic privileges Jeff has some default and reserved privileges classes and identifiers, which may be checked using the following class parameters and null as $pids.

  • public_view: generic privilege which allows to view public contents
  • private_view: generic privilege which allows to view private contents (the user must be logged in)
  • admin_view: generic privilege which allows to view the administrative area
  • admin: complete administration of the web application
Author:
abidibo abidi.nosp@m.bo@g.nosp@m.mail..nosp@m.com
Version:
0.99
Date:
2011-2012

Definition at line 46 of file access.class.php.


Member Function Documentation

static access::check ( class = null,
pids = null,
opts = null 
) [static]

Checks if the user has the right privileges to acess the requested content.

Parameters:
string$classthe privilege class (a standard identifier or a real class)
mixed$pidsthe privilege identifier for the given class
mixed$optsassociative array of options:
  • exitOnFailure: whether to redirect to the noaccess page if the user doesn't have the right privileges.
Returns:
true if the user has the right privileges, false or redirect to the no access page otherwise.

Definition at line 58 of file access.class.php.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static access::hasGroup ( group_ids) [static]

Checks if the user belongs to at least one of the given groups.

Parameters:
array$group_idsarray containing all the identifiers of the groups to check.
Returns:
true if the user belongs to at least one group, false otherwise

Definition at line 116 of file access.class.php.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:


The documentation for this class was generated from the following file: