seeddms-code/controllers/class.RoleMgr.php

57 lines
1.3 KiB
PHP
Raw Normal View History

2016-04-13 16:31:28 +00:00
<?php
/**
* Implementation of Role manager controller
*
* @category DMS
* @package SeedDMS
* @license GPL 2
* @version @version@
* @author Uwe Steinmann <uwe@steinmann.cx>
* @copyright Copyright (C) 2010-2013 Uwe Steinmann
* @version Release: @package_version@
*/
/**
* Class which does the busines logic for role manager
*
* @category DMS
* @package SeedDMS
* @author Uwe Steinmann <uwe@steinmann.cx>
* @copyright Copyright (C) 2010-2013 Uwe Steinmann
* @version Release: @package_version@
*/
class SeedDMS_Controller_RoleMgr extends SeedDMS_Controller_Common {
public function run() {
}
public function addrole() {
$dms = $this->params['dms'];
$name = $this->params['name'];
$role = $this->params['role'];
return($dms->addRole($name, $role));
}
public function removerole() {
$roleobj = $this->params['roleobj'];
return $roleobj->remove();
}
public function editrole() {
$dms = $this->params['dms'];
$name = $this->params['name'];
$role = $this->params['role'];
$roleobj = $this->params['roleobj'];
$noaccess = $this->params['noaccess'];
if ($roleobj->getName() != $name)
$roleobj->setName($name);
if ($roleobj->getRole() != $role)
$roleobj->setRole($role);
$roleobj->setNoAccess($noaccess);
return true;
}
}