mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-02-06 15:14:58 +00:00
addititional lecacy right can be added
This commit is contained in:
parent
3eb830855a
commit
fcf5c9be93
|
@ -45,11 +45,109 @@ class SeedDMS_AccessOperation {
|
|||
*/
|
||||
private $settings;
|
||||
|
||||
/**
|
||||
* @var array $legacy_access list of objects with access
|
||||
* @access protected
|
||||
*/
|
||||
private $legacy_access;
|
||||
|
||||
function __construct($dms, $obj, $user, $settings) { /* {{{ */
|
||||
$this->dms = $dms;
|
||||
$this->obj = $obj;
|
||||
$this->user = $user;
|
||||
$this->settings = $settings;
|
||||
$this->legacy_access['guest'] = array(
|
||||
'Calendar',
|
||||
'ErrorDlg',
|
||||
'Help',
|
||||
'Login',
|
||||
'Search',
|
||||
'ViewDocument',
|
||||
'ViewFolder',
|
||||
);
|
||||
$this->legacy_access['user'] = array(
|
||||
'AddDocument',
|
||||
'AddDocumentLink',
|
||||
'AddEvent',
|
||||
'AddFile',
|
||||
'AddSubFolder',
|
||||
'AddToTransmittal',
|
||||
'ApprovalSummary',
|
||||
'ApproveDocument',
|
||||
'Calendar',
|
||||
'CategoryChooser',
|
||||
'ChangePassword',
|
||||
'CheckInDocument',
|
||||
'Clipboard',
|
||||
'Dashboard',
|
||||
'DocumentAccess',
|
||||
'DocumentChooser',
|
||||
'DocumentNotify',
|
||||
'DocumentVersionDetail',
|
||||
'DropFolderChooser',
|
||||
'EditAttributes',
|
||||
'EditComment',
|
||||
'EditDocumentFile',
|
||||
'EditDocument',
|
||||
'EditEvent',
|
||||
'EditFolder',
|
||||
'EditOnline',
|
||||
'EditUserData',
|
||||
'ErrorDlg',
|
||||
'FolderAccess',
|
||||
'FolderChooser',
|
||||
'FolderNotify',
|
||||
'ForcePasswordChange',
|
||||
'GroupView',
|
||||
'Help',
|
||||
'KeywordChooser',
|
||||
'Login',
|
||||
'ManageNotify',
|
||||
'MoveDocument',
|
||||
'MoveFolder',
|
||||
'MyAccount',
|
||||
'MyDocuments',
|
||||
'OpensearchDesc',
|
||||
'OverrideContentStatus',
|
||||
'PasswordForgotten',
|
||||
'PasswordSend',
|
||||
'ReceiptDocument',
|
||||
'ReceiptSummary',
|
||||
'RemoveDocumentFile',
|
||||
'RemoveDocument',
|
||||
'RemoveEvent',
|
||||
'RemoveFolderFiles',
|
||||
'RemoveFolder',
|
||||
'RemoveTransmittal',
|
||||
'RemoveVersion',
|
||||
'RemoveWorkflowFromDocument',
|
||||
'ReturnFromSubWorkflow',
|
||||
'ReviewDocument',
|
||||
'ReviewSummary',
|
||||
'ReviseDocument',
|
||||
'RevisionSummary',
|
||||
'RewindWorkflow',
|
||||
'RunSubWorkflow',
|
||||
'Search',
|
||||
'Session',
|
||||
'SetExpires',
|
||||
'SetRecipients',
|
||||
'SetReviewersApprovers',
|
||||
'SetRevisors',
|
||||
'SetWorkflow',
|
||||
'SubstituteUser',
|
||||
'Tasks',
|
||||
'TransmittalMgr',
|
||||
'TriggerWorkflow',
|
||||
'UpdateDocument',
|
||||
'UserDefaultKeywords',
|
||||
'UserImage',
|
||||
'UsrView',
|
||||
'ViewDocument',
|
||||
'ViewEvent',
|
||||
'ViewFolder',
|
||||
'WorkflowGraph',
|
||||
'WorkflowSummary');
|
||||
} /* }}} */
|
||||
|
||||
/**
|
||||
|
@ -88,7 +186,7 @@ class SeedDMS_AccessOperation {
|
|||
function mayRemoveVersion() { /* {{{ */
|
||||
if($this->obj->isType('document')) {
|
||||
$versions = $this->obj->getContent();
|
||||
if ((($this->settings->_enableVersionDeletion && ($this->obj->getAccessMode($this->user) == M_ALL)) || $this->user->isAdmin() ) && (count($versions) > 1)) {
|
||||
if ((($this->settings->_enableVersionDeletion && ($this->obj->getAccessMode($this->user, 'removeVersion') == M_ALL)) || $this->user->isAdmin() ) && (count($versions) > 1)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -314,6 +412,12 @@ class SeedDMS_AccessOperation {
|
|||
return false;
|
||||
} /* }}} */
|
||||
|
||||
public function allowLegacyAccess($access, $role) { /* {{{ */
|
||||
if($role == 'user' || $role == 'guest') {
|
||||
$this->legacy_access[$role][] = $access;
|
||||
}
|
||||
} /* }}} */
|
||||
|
||||
protected function check_view_legacy_access($view, $get=array()) { /* {{{ */
|
||||
if($this->user->isAdmin())
|
||||
return true;
|
||||
|
@ -329,99 +433,9 @@ class SeedDMS_AccessOperation {
|
|||
}
|
||||
|
||||
if($this->user->isGuest()) {
|
||||
$user_allowed = array(
|
||||
'Calendar',
|
||||
'ErrorDlg',
|
||||
'Help',
|
||||
'Login',
|
||||
'Search',
|
||||
'ViewDocument',
|
||||
'ViewFolder',
|
||||
);
|
||||
$user_allowed = $this->legacy_access['guest'];
|
||||
} else {
|
||||
$user_allowed = array(
|
||||
'AddDocument',
|
||||
'AddDocumentLink',
|
||||
'AddEvent',
|
||||
'AddFile',
|
||||
'AddSubFolder',
|
||||
'AddToTransmittal',
|
||||
'ApprovalSummary',
|
||||
'ApproveDocument',
|
||||
'Calendar',
|
||||
'CategoryChooser',
|
||||
'ChangePassword',
|
||||
'CheckInDocument',
|
||||
'Clipboard',
|
||||
'Dashboard',
|
||||
'DocumentAccess',
|
||||
'DocumentChooser',
|
||||
'DocumentNotify',
|
||||
'DocumentVersionDetail',
|
||||
'DropFolderChooser',
|
||||
'EditAttributes',
|
||||
'EditComment',
|
||||
'EditDocumentFile',
|
||||
'EditDocument',
|
||||
'EditEvent',
|
||||
'EditFolder',
|
||||
'EditOnline',
|
||||
'EditUserData',
|
||||
'ErrorDlg',
|
||||
'FolderAccess',
|
||||
'FolderChooser',
|
||||
'FolderNotify',
|
||||
'ForcePasswordChange',
|
||||
'GroupView',
|
||||
'Help',
|
||||
'KeywordChooser',
|
||||
'Login',
|
||||
'ManageNotify',
|
||||
'MoveDocument',
|
||||
'MoveFolder',
|
||||
'MyAccount',
|
||||
'MyDocuments',
|
||||
'OpensearchDesc',
|
||||
'OverrideContentStatus',
|
||||
'PasswordForgotten',
|
||||
'PasswordSend',
|
||||
'ReceiptDocument',
|
||||
'ReceiptSummary',
|
||||
'RemoveDocumentFile',
|
||||
'RemoveDocument',
|
||||
'RemoveEvent',
|
||||
'RemoveFolderFiles',
|
||||
'RemoveFolder',
|
||||
'RemoveTransmittal',
|
||||
'RemoveVersion',
|
||||
'RemoveWorkflowFromDocument',
|
||||
'ReturnFromSubWorkflow',
|
||||
'ReviewDocument',
|
||||
'ReviewSummary',
|
||||
'ReviseDocument',
|
||||
'RevisionSummary',
|
||||
'RewindWorkflow',
|
||||
'RunSubWorkflow',
|
||||
'Search',
|
||||
'Session',
|
||||
'SetExpires',
|
||||
'SetRecipients',
|
||||
'SetReviewersApprovers',
|
||||
'SetRevisors',
|
||||
'SetWorkflow',
|
||||
'SubstituteUser',
|
||||
'Tasks',
|
||||
'TransmittalMgr',
|
||||
'TriggerWorkflow',
|
||||
'UpdateDocument',
|
||||
'UserDefaultKeywords',
|
||||
'UserImage',
|
||||
'UsrView',
|
||||
'ViewDocument',
|
||||
'ViewEvent',
|
||||
'ViewFolder',
|
||||
'WorkflowGraph',
|
||||
'WorkflowSummary');
|
||||
$user_allowed = $this->legacy_access['user'];
|
||||
}
|
||||
|
||||
if(array_intersect($scripts, $user_allowed))
|
||||
|
|
Loading…
Reference in New Issue
Block a user