parent
2d1105ab0f
commit
a3e3d6bcfd
1 changed files with 23 additions and 10 deletions
|
@ -23,7 +23,7 @@
|
||||||
|
|
||||||
|
|
||||||
Author : $Author: tomas $
|
Author : $Author: tomas $
|
||||||
Version : $Revision: 1.11 $
|
Version : $Revision: 1.12 $
|
||||||
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/alib/var/alib.php,v $
|
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/alib/var/alib.php,v $
|
||||||
|
|
||||||
------------------------------------------------------------------------------*/
|
------------------------------------------------------------------------------*/
|
||||||
|
@ -40,7 +40,7 @@ define('ALIBERR_NOTEXISTS', 31);
|
||||||
* authentication/authorization class
|
* authentication/authorization class
|
||||||
*
|
*
|
||||||
* @author $Author: tomas $
|
* @author $Author: tomas $
|
||||||
* @version $Revision: 1.11 $
|
* @version $Revision: 1.12 $
|
||||||
* @see Subjects
|
* @see Subjects
|
||||||
* @see GreenBox
|
* @see GreenBox
|
||||||
*/
|
*/
|
||||||
|
@ -150,11 +150,11 @@ class Alib extends Subjects{
|
||||||
/**
|
/**
|
||||||
* Insert permission record
|
* Insert permission record
|
||||||
*
|
*
|
||||||
* @param sid int
|
* @param sid int - local user/group id
|
||||||
* @param action string
|
* @param action string
|
||||||
* @param oid int
|
* @param oid int - local object id
|
||||||
* @param type char
|
* @param type char - 'A'|'D' (allow/deny)
|
||||||
* @return int/err
|
* @return int - local permission id
|
||||||
*/
|
*/
|
||||||
function addPerm($sid, $action, $oid, $type='A')
|
function addPerm($sid, $action, $oid, $type='A')
|
||||||
{
|
{
|
||||||
|
@ -170,10 +170,10 @@ class Alib extends Subjects{
|
||||||
/**
|
/**
|
||||||
* Remove permission record
|
* Remove permission record
|
||||||
*
|
*
|
||||||
* @param permid int OPT
|
* @param permid int OPT - local permission id
|
||||||
* @param subj int OPT
|
* @param subj int OPT - local user/group id
|
||||||
* @param obj int OPT
|
* @param obj int OPT - local object id
|
||||||
* @return null/error
|
* @return boolean/error
|
||||||
*/
|
*/
|
||||||
function removePerm($permid=NULL, $subj=NULL, $obj=NULL)
|
function removePerm($permid=NULL, $subj=NULL, $obj=NULL)
|
||||||
{
|
{
|
||||||
|
@ -186,6 +186,19 @@ class Alib extends Subjects{
|
||||||
return $this->dbc->query("DELETE FROM {$this->permTable} WHERE $cond");
|
return $this->dbc->query("DELETE FROM {$this->permTable} WHERE $cond");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return object related with permission record
|
||||||
|
*
|
||||||
|
* @param permid int - local permission id
|
||||||
|
* @return int - local object id
|
||||||
|
*/
|
||||||
|
function _getPermOid($permid)
|
||||||
|
{
|
||||||
|
$res = $this->dbc->getOne(
|
||||||
|
"SELECT obj FROM {$this->permTable} WHERE permid=$permid");
|
||||||
|
return $res;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if specified subject have permission to specified action
|
* Check if specified subject have permission to specified action
|
||||||
* on specified object
|
* on specified object
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue