mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-02-06 07:04:57 +00:00
enhance AccessOperation by check_view_access()
all methods in SeedDMS_AccessOperation take the object to be checked as the first parameter. Add new method check_view_access() which checks if a view may be accessed based on the tables tblAros, tblAcos, tblArosAcos
This commit is contained in:
parent
8985748f8a
commit
51fa5d18e6
|
@ -11,6 +11,8 @@
|
|||
* @version Release: @package_version@
|
||||
*/
|
||||
|
||||
require_once "inc.ClassAcl.php";
|
||||
|
||||
/**
|
||||
* Class to check certain access restrictions
|
||||
*
|
||||
|
@ -27,12 +29,6 @@ class SeedDMS_AccessOperation {
|
|||
*/
|
||||
private $dms;
|
||||
|
||||
/**
|
||||
* @var object $obj object being accessed
|
||||
* @access protected
|
||||
*/
|
||||
private $obj;
|
||||
|
||||
/**
|
||||
* @var object $user user requesting the access
|
||||
* @access protected
|
||||
|
@ -45,9 +41,8 @@ class SeedDMS_AccessOperation {
|
|||
*/
|
||||
private $settings;
|
||||
|
||||
function __construct($dms, $obj, $user, $settings) { /* {{{ */
|
||||
function __construct($dms, $user, $settings) { /* {{{ */
|
||||
$this->dms = $dms;
|
||||
$this->obj = $obj;
|
||||
$this->user = $user;
|
||||
$this->settings = $settings;
|
||||
} /* }}} */
|
||||
|
@ -61,10 +56,10 @@ class SeedDMS_AccessOperation {
|
|||
* document may delete versions. The admin may even delete a version
|
||||
* even if is disallowed in the settings.
|
||||
*/
|
||||
function mayRemoveVersion() { /* {{{ */
|
||||
if(get_class($this->obj) == $this->dms->getClassname('document')) {
|
||||
$versions = $this->obj->getContent();
|
||||
if ((($this->settings->_enableVersionDeletion && ($this->obj->getAccessMode($this->user) == M_ALL)) || $this->user->isAdmin() ) && (count($versions) > 1)) {
|
||||
function mayRemoveVersion($document) { /* {{{ */
|
||||
if(get_class($document) == $this->dms->getClassname('document')) {
|
||||
$versions = $document->getContent();
|
||||
if ((($this->settings->_enableVersionDeletion && ($document->getAccessMode($this->user) == M_ALL)) || $this->user->isAdmin() ) && (count($versions) > 1)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -81,11 +76,11 @@ class SeedDMS_AccessOperation {
|
|||
* The admin may even modify the status
|
||||
* even if is disallowed in the settings.
|
||||
*/
|
||||
function mayOverrideStatus() { /* {{{ */
|
||||
if(get_class($this->obj) == $this->dms->getClassname('document')) {
|
||||
$latestContent = $this->obj->getLatestContent();
|
||||
function mayOverrideStatus($document) { /* {{{ */
|
||||
if(get_class($document) == $this->dms->getClassname('document')) {
|
||||
$latestContent = $document->getLatestContent();
|
||||
$status = $latestContent->getStatus();
|
||||
if ((($this->settings->_enableVersionModification && ($this->obj->getAccessMode($this->user) == M_ALL)) || $this->user->isAdmin()) && ($status["status"]==S_DRAFT || $status["status"]==S_RELEASED || $status["status"]==S_OBSOLETE)) {
|
||||
if ((($this->settings->_enableVersionModification && ($document->getAccessMode($this->user) == M_ALL)) || $this->user->isAdmin()) && ($status["status"]==S_DRAFT || $status["status"]==S_RELEASED || $status["status"]==S_OBSOLETE)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -101,11 +96,11 @@ class SeedDMS_AccessOperation {
|
|||
* admin may even set reviewers/approvers if is disallowed in the
|
||||
* settings.
|
||||
*/
|
||||
function maySetReviewersApprovers() { /* {{{ */
|
||||
if(get_class($this->obj) == $this->dms->getClassname('document')) {
|
||||
$latestContent = $this->obj->getLatestContent();
|
||||
function maySetReviewersApprovers($document) { /* {{{ */
|
||||
if(get_class($document) == $this->dms->getClassname('document')) {
|
||||
$latestContent = $document->getLatestContent();
|
||||
$status = $latestContent->getStatus();
|
||||
if ((($this->settings->_enableVersionModification && ($this->obj->getAccessMode($this->user) == M_ALL)) || $this->user->isAdmin()) && ($status['status']==S_DRAFT || $status["status"]==S_DRAFT_REV || $status["status"]==S_DRAFT_APP && $this->settings->_workflowMode == 'traditional_only_approval')) {
|
||||
if ((($this->settings->_enableVersionModification && ($document->getAccessMode($this->user) == M_ALL)) || $this->user->isAdmin()) && ($status['status']==S_DRAFT || $status["status"]==S_DRAFT_REV || $status["status"]==S_DRAFT_APP && $this->settings->_workflowMode == 'traditional_only_approval')) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -121,11 +116,11 @@ class SeedDMS_AccessOperation {
|
|||
* admin may even set recipients if is disallowed in the
|
||||
* settings.
|
||||
*/
|
||||
function maySetRecipients() { /* {{{ */
|
||||
if(get_class($this->obj) == $this->dms->getClassname('document')) {
|
||||
$latestContent = $this->obj->getLatestContent();
|
||||
function maySetRecipients($document) { /* {{{ */
|
||||
if(get_class($document) == $this->dms->getClassname('document')) {
|
||||
$latestContent = $document->getLatestContent();
|
||||
$status = $latestContent->getStatus();
|
||||
if ((($this->settings->_enableVersionModification && ($this->obj->getAccessMode($this->user) == M_ALL)) || $this->user->isAdmin()) && ($status["status"]==S_RELEASED)) {
|
||||
if ((($this->settings->_enableVersionModification && ($document->getAccessMode($this->user) == M_ALL)) || $this->user->isAdmin()) && ($status["status"]==S_RELEASED)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -141,11 +136,11 @@ class SeedDMS_AccessOperation {
|
|||
* admin may even set revisors if is disallowed in the
|
||||
* settings.
|
||||
*/
|
||||
function maySetRevisors() { /* {{{ */
|
||||
if(get_class($this->obj) == $this->dms->getClassname('document')) {
|
||||
$latestContent = $this->obj->getLatestContent();
|
||||
function maySetRevisors($document) { /* {{{ */
|
||||
if(get_class($document) == $this->dms->getClassname('document')) {
|
||||
$latestContent = $document->getLatestContent();
|
||||
$status = $latestContent->getStatus();
|
||||
if (($this->settings->_enableVersionModification && ($this->obj->getAccessMode($this->user) == M_ALL)) || $this->user->isAdmin() /* && ($status["status"]==S_RELEASED || $status["status"]==S_IN_REVISION)*/) {
|
||||
if (($this->settings->_enableVersionModification && ($document->getAccessMode($this->user) == M_ALL)) || $this->user->isAdmin() /* && ($status["status"]==S_RELEASED || $status["status"]==S_IN_REVISION)*/) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -161,11 +156,11 @@ class SeedDMS_AccessOperation {
|
|||
* admin may even set the workflow if is disallowed in the
|
||||
* settings.
|
||||
*/
|
||||
function maySetWorkflow() { /* {{{ */
|
||||
if(get_class($this->obj) == $this->dms->getClassname('document')) {
|
||||
$latestContent = $this->obj->getLatestContent();
|
||||
function maySetWorkflow($document) { /* {{{ */
|
||||
if(get_class($document) == $this->dms->getClassname('document')) {
|
||||
$latestContent = $document->getLatestContent();
|
||||
$workflow = $latestContent->getWorkflow();
|
||||
if ((($this->settings->_enableVersionModification && ($this->obj->getAccessMode($this->user) == M_ALL)) || $this->user->isAdmin()) && (!$workflow || ($workflow->getInitState()->getID() == $latestContent->getWorkflowState()->getID()))) {
|
||||
if ((($this->settings->_enableVersionModification && ($document->getAccessMode($this->user) == M_ALL)) || $this->user->isAdmin()) && (!$workflow || ($workflow->getInitState()->getID() == $latestContent->getWorkflowState()->getID()))) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -178,11 +173,11 @@ class SeedDMS_AccessOperation {
|
|||
* This check can only be done for documents. Setting the documents
|
||||
* expiration date is only allowed if the document has not been obsoleted.
|
||||
*/
|
||||
function maySetExpires() { /* {{{ */
|
||||
if(get_class($this->obj) == $this->dms->getClassname('document')) {
|
||||
$latestContent = $this->obj->getLatestContent();
|
||||
function maySetExpires($document) { /* {{{ */
|
||||
if(get_class($document) == $this->dms->getClassname('document')) {
|
||||
$latestContent = $document->getLatestContent();
|
||||
$status = $latestContent->getStatus();
|
||||
if ((($this->obj->getAccessMode($this->user) == M_ALL) || $this->user->isAdmin()) && ($status["status"]!=S_OBSOLETE)) {
|
||||
if ((($document->getAccessMode($this->user) == M_ALL) || $this->user->isAdmin()) && ($status["status"]!=S_OBSOLETE)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -198,17 +193,17 @@ class SeedDMS_AccessOperation {
|
|||
* The admin may set the comment even if is
|
||||
* disallowed in the settings.
|
||||
*/
|
||||
function mayEditComment() { /* {{{ */
|
||||
if(get_class($this->obj) == $this->dms->getClassname('document')) {
|
||||
if($this->obj->isLocked()) {
|
||||
$lockingUser = $this->obj->getLockingUser();
|
||||
if (($lockingUser->getID() != $this->user->getID()) && ($this->obj->getAccessMode($this->user) != M_ALL)) {
|
||||
function mayEditComment($document) { /* {{{ */
|
||||
if(get_class($document) == $this->dms->getClassname('document')) {
|
||||
if($document->isLocked()) {
|
||||
$lockingUser = $document->getLockingUser();
|
||||
if (($lockingUser->getID() != $this->user->getID()) && ($document->getAccessMode($this->user) != M_ALL)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
$latestContent = $this->obj->getLatestContent();
|
||||
$latestContent = $document->getLatestContent();
|
||||
$status = $latestContent->getStatus();
|
||||
if ((($this->settings->_enableVersionModification && ($this->obj->getAccessMode($this->user) >= M_READWRITE)) || $this->user->isAdmin()) && ($status["status"]!=S_OBSOLETE)) {
|
||||
if ((($this->settings->_enableVersionModification && ($document->getAccessMode($this->user) >= M_READWRITE)) || $this->user->isAdmin()) && ($status["status"]!=S_OBSOLETE)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -224,12 +219,12 @@ class SeedDMS_AccessOperation {
|
|||
* The admin may set the comment even if is
|
||||
* disallowed in the settings.
|
||||
*/
|
||||
function mayEditAttributes() { /* {{{ */
|
||||
if(get_class($this->obj) == $this->dms->getClassname('document')) {
|
||||
$latestContent = $this->obj->getLatestContent();
|
||||
function mayEditAttributes($document) { /* {{{ */
|
||||
if(get_class($document) == $this->dms->getClassname('document')) {
|
||||
$latestContent = $document->getLatestContent();
|
||||
$status = $latestContent->getStatus();
|
||||
$workflow = $latestContent->getWorkflow();
|
||||
if ((($this->settings->_enableVersionModification && ($this->obj->getAccessMode($this->user) >= M_READWRITE)) || $this->user->isAdmin()) && ($status["status"]==S_DRAFT_REV || ($workflow && $workflow->getInitState()->getID() == $latestContent->getWorkflowState()->getID()))) {
|
||||
if ((($this->settings->_enableVersionModification && ($document->getAccessMode($this->user) >= M_READWRITE)) || $this->user->isAdmin()) && ($status["status"]==S_DRAFT_REV || ($workflow && $workflow->getInitState()->getID() == $latestContent->getWorkflowState()->getID()))) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -243,9 +238,9 @@ class SeedDMS_AccessOperation {
|
|||
* obsoleted. There are other requirements which are not taken into
|
||||
* account here.
|
||||
*/
|
||||
function mayReview() { /* {{{ */
|
||||
if(get_class($this->obj) == $this->dms->getClassname('document')) {
|
||||
$latestContent = $this->obj->getLatestContent();
|
||||
function mayReview($document) { /* {{{ */
|
||||
if(get_class($document) == $this->dms->getClassname('document')) {
|
||||
$latestContent = $document->getLatestContent();
|
||||
$status = $latestContent->getStatus();
|
||||
if ($status["status"]!=S_OBSOLETE) {
|
||||
return true;
|
||||
|
@ -262,9 +257,9 @@ class SeedDMS_AccessOperation {
|
|||
* There are other requirements which are not taken into
|
||||
* account here.
|
||||
*/
|
||||
function mayApprove() { /* {{{ */
|
||||
if(get_class($this->obj) == $this->dms->getClassname('document')) {
|
||||
$latestContent = $this->obj->getLatestContent();
|
||||
function mayApprove($document) { /* {{{ */
|
||||
if(get_class($document) == $this->dms->getClassname('document')) {
|
||||
$latestContent = $document->getLatestContent();
|
||||
$status = $latestContent->getStatus();
|
||||
if ($status["status"]!=S_OBSOLETE && $status["status"]!=S_DRAFT_REV && $status["status"]!=S_REJECTED) {
|
||||
return true;
|
||||
|
@ -280,9 +275,9 @@ class SeedDMS_AccessOperation {
|
|||
* obsoleted. There are other requirements which are not taken into
|
||||
* account here.
|
||||
*/
|
||||
function mayReceipt() { /* {{{ */
|
||||
if(get_class($this->obj) == $this->dms->getClassname('document')) {
|
||||
$latestContent = $this->obj->getLatestContent();
|
||||
function mayReceipt($document) { /* {{{ */
|
||||
if(get_class($document) == $this->dms->getClassname('document')) {
|
||||
$latestContent = $document->getLatestContent();
|
||||
$status = $latestContent->getStatus();
|
||||
if ($status["status"]!=S_OBSOLETE) {
|
||||
return true;
|
||||
|
@ -298,9 +293,9 @@ class SeedDMS_AccessOperation {
|
|||
* obsoleted. There are other requirements which are not taken into
|
||||
* account here.
|
||||
*/
|
||||
function mayRevise() { /* {{{ */
|
||||
if(get_class($this->obj) == $this->dms->getClassname('document')) {
|
||||
$latestContent = $this->obj->getLatestContent();
|
||||
function mayRevise($document) { /* {{{ */
|
||||
if(get_class($document) == $this->dms->getClassname('document')) {
|
||||
$latestContent = $document->getLatestContent();
|
||||
$status = $latestContent->getStatus();
|
||||
if ($status["status"]!=S_OBSOLETE) {
|
||||
return true;
|
||||
|
@ -309,5 +304,24 @@ class SeedDMS_AccessOperation {
|
|||
return false;
|
||||
} /* }}} */
|
||||
|
||||
/**
|
||||
* Check for access permission
|
||||
*
|
||||
* @param object $dms Instanz of dms
|
||||
* @param object $role role of currently logged in user
|
||||
* @param string $scope 'Views', 'Controllers'
|
||||
* @param string $script Scriptname without 'out.' and '.php'
|
||||
* @param string $get query parameters
|
||||
* @return boolean true if access is allowed otherwise false
|
||||
*/
|
||||
function check_view_access($view, $get=array()) { /* {{{ */
|
||||
$scope = 'Views';
|
||||
$script = $view->getParam('class');
|
||||
$action = (isset($get['action']) && $get['action']) ? $get['action'] : 'show';
|
||||
$acl = new SeedDMS_Acl($this->dms);
|
||||
$aro = SeedDMS_Aro::getInstance($this->user->getRole(), $this->dms);
|
||||
$aco = SeedDMS_Aco::getInstance($scope.'/'.$script.'/'.$action, $this->dms);
|
||||
return $acl->check($aro, $aco);
|
||||
} /* }}} */
|
||||
}
|
||||
?>
|
||||
|
|
|
@ -74,11 +74,11 @@ if ($latestContent->getVersion()!=$version) {
|
|||
}
|
||||
|
||||
/* Create object for checking access to certain operations */
|
||||
$accessop = new SeedDMS_AccessOperation($dms, $document, $user, $settings);
|
||||
$accessop = new SeedDMS_AccessOperation($dms, $user, $settings);
|
||||
|
||||
$olddocstatus = $content->getStatus();
|
||||
// verify if document may be approved
|
||||
if (!$accessop->mayApprove()){
|
||||
if (!$accessop->mayApprove($document)){
|
||||
UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("access_denied"));
|
||||
}
|
||||
|
||||
|
|
|
@ -73,10 +73,10 @@ if ($latestContent->getVersion()!=$version) {
|
|||
}
|
||||
|
||||
/* Create object for checking access to certain operations */
|
||||
$accessop = new SeedDMS_AccessOperation($dms, $document, $user, $settings);
|
||||
$accessop = new SeedDMS_AccessOperation($dms, $user, $settings);
|
||||
|
||||
// verify if document may be receіpted
|
||||
if (!$accessop->mayReceipt()){
|
||||
if (!$accessop->mayReceipt($document)){
|
||||
UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("access_denied"));
|
||||
}
|
||||
|
||||
|
|
|
@ -73,11 +73,11 @@ if ($latestContent->getVersion()!=$version) {
|
|||
}
|
||||
|
||||
/* Create object for checking access to certain operations */
|
||||
$accessop = new SeedDMS_AccessOperation($dms, $document, $user, $settings);
|
||||
$accessop = new SeedDMS_AccessOperation($dms, $user, $settings);
|
||||
|
||||
$olddocstatus = $content->getStatus();
|
||||
// verify if document may be reviewed
|
||||
if (!$accessop->mayReview()){
|
||||
if (!$accessop->mayReview($document)){
|
||||
UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("access_denied"));
|
||||
}
|
||||
|
||||
|
|
|
@ -73,11 +73,11 @@ if ($latestContent->getVersion()!=$version) {
|
|||
}
|
||||
|
||||
/* Create object for checking access to certain operations */
|
||||
$accessop = new SeedDMS_AccessOperation($dms, $document, $user, $settings);
|
||||
$accessop = new SeedDMS_AccessOperation($dms, $user, $settings);
|
||||
|
||||
$olddocstatus = $content->getStatus();
|
||||
// verify if document maybe revised
|
||||
if (!$document->mayRevise()){
|
||||
if (!$accessop->mayRevise($document)){
|
||||
UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("access_denied"));
|
||||
}
|
||||
|
||||
|
|
|
@ -55,7 +55,7 @@ $folder = $document->getFolder();
|
|||
$transmittals = $dms->getAllTransmittals($user);
|
||||
|
||||
/* Create object for checking access to certain operations */
|
||||
$accessop = new SeedDMS_AccessOperation($dms, $document, $user, $settings);
|
||||
$accessop = new SeedDMS_AccessOperation($dms, $user, $settings);
|
||||
|
||||
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
|
||||
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user, 'folder'=>$folder, 'document'=>$document, 'version'=>$content));
|
||||
|
|
|
@ -41,7 +41,7 @@ if (!is_object($document)) {
|
|||
$folder = $document->getFolder();
|
||||
|
||||
/* Create object for checking access to certain operations */
|
||||
$accessop = new SeedDMS_AccessOperation($dms, $document, $user, $settings);
|
||||
$accessop = new SeedDMS_AccessOperation($dms, $user, $settings);
|
||||
|
||||
if ($document->getAccessMode($user) < M_READ) {
|
||||
UI::exitError(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName()))),getMLText("access_denied"));
|
||||
|
|
|
@ -60,7 +60,7 @@ if($settings->_quota > 0) {
|
|||
$folder = $document->getFolder();
|
||||
|
||||
/* Create object for checking access to certain operations */
|
||||
$accessop = new SeedDMS_AccessOperation($dms, $document, $user, $settings);
|
||||
$accessop = new SeedDMS_AccessOperation($dms, $user, $settings);
|
||||
|
||||
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
|
||||
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user, 'folder'=>$folder, 'document'=>$document, 'strictformcheck'=>$settings->_strictFormCheck, 'enablelargefileupload'=>$settings->_enableLargeFileUpload, 'enableadminrevapp'=>$settings->_enableAdminRevApp, 'enableownerrevapp'=>$settings->_enableOwnerRevApp, 'enableselfrevapp'=>$settings->_enableSelfRevApp, 'dropfolderdir'=>$settings->_dropFolderDir, 'workflowmode'=>$settings->_workflowMode, 'presetexpiration'=>$settings->_presetExpirationDate));
|
||||
|
|
|
@ -47,7 +47,7 @@ $allUsers = $dms->getAllUsers($settings->_sortUsersInList);
|
|||
$allGroups = $dms->getAllGroups();
|
||||
|
||||
/* Create object for checking access to certain operations */
|
||||
$accessop = new SeedDMS_AccessOperation($dms, $document, $user, $settings);
|
||||
$accessop = new SeedDMS_AccessOperation($dms, $user, $settings);
|
||||
|
||||
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
|
||||
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user, 'folder'=>$folder, 'document'=>$document, 'allusers'=>$allUsers, 'allgroups'=>$allGroups));
|
||||
|
|
|
@ -45,7 +45,7 @@ if ($document->getAccessMode($user) < M_READ) {
|
|||
}
|
||||
|
||||
/* Create object for checking access to certain operations */
|
||||
$accessop = new SeedDMS_AccessOperation($dms, $document, $user, $settings);
|
||||
$accessop = new SeedDMS_AccessOperation($dms, $user, $settings);
|
||||
|
||||
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
|
||||
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user, 'folder'=>$folder, 'document'=>$document, 'sortusersinlist'=>$settings->_sortUsersInList));
|
||||
|
|
|
@ -67,7 +67,7 @@ if ($latestContent->getVersion()==$version->getVersion()) {
|
|||
$folder = $document->getFolder();
|
||||
|
||||
/* Create object for checking access to certain operations */
|
||||
$accessop = new SeedDMS_AccessOperation($dms, $document, $user, $settings);
|
||||
$accessop = new SeedDMS_AccessOperation($dms, $user, $settings);
|
||||
|
||||
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
|
||||
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user, 'folder'=>$folder, 'document'=>$document, 'version'=>$version, 'viewonlinefiletypes'=>$settings->_viewOnlineFileTypes, 'enableversionmodification'=>$settings->_enableVersionModification, 'previewWidthDetail'=>$settings->_previewWidthDetail, 'previewconverters'=>$settings->_converters['preview'], 'cachedir'=>$settings->_cacheDir, 'timeout'=>$settings->_cmdTimeout));
|
||||
|
|
|
@ -46,7 +46,7 @@ if (!is_object($version)) {
|
|||
$folder = $document->getFolder();
|
||||
|
||||
/* Create object for checking access to certain operations */
|
||||
$accessop = new SeedDMS_AccessOperation($dms, $document, $user, $settings);
|
||||
$accessop = new SeedDMS_AccessOperation($dms, $user, $settings);
|
||||
|
||||
$attrdefs = $dms->getAllAttributeDefinitions(array(SeedDMS_Core_AttributeDefinition::objtype_documentcontent, SeedDMS_Core_AttributeDefinition::objtype_all));
|
||||
|
||||
|
|
|
@ -51,7 +51,7 @@ if (!is_object($version)) {
|
|||
$folder = $document->getFolder();
|
||||
|
||||
/* Create object for checking access to certain operations */
|
||||
$accessop = new SeedDMS_AccessOperation($dms, $document, $user, $settings);
|
||||
$accessop = new SeedDMS_AccessOperation($dms, $user, $settings);
|
||||
|
||||
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
|
||||
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user, 'folder'=>$folder, 'document'=>$document, 'version'=>$version, 'strictformcheck'=>$settings->_strictFormCheck));
|
||||
|
|
|
@ -51,7 +51,7 @@ $folder = $document->getFolder();
|
|||
$attrdefs = $dms->getAllAttributeDefinitions(array(SeedDMS_Core_AttributeDefinition::objtype_document, SeedDMS_Core_AttributeDefinition::objtype_all));
|
||||
|
||||
/* Create object for checking access to certain operations */
|
||||
$accessop = new SeedDMS_AccessOperation($dms, $document, $user, $settings);
|
||||
$accessop = new SeedDMS_AccessOperation($dms, $user, $settings);
|
||||
|
||||
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
|
||||
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user, 'folder'=>$folder, 'document'=>$document, 'attrdefs'=>$attrdefs, 'strictformcheck'=>$settings->_strictFormCheck, 'orderby'=>$settings->_sortFoldersDefault));
|
||||
|
|
|
@ -64,7 +64,7 @@ if(isset($_GET['targetid']) && $_GET['targetid']) {
|
|||
$folder = $document->getFolder();
|
||||
|
||||
/* Create object for checking access to certain operations */
|
||||
$accessop = new SeedDMS_AccessOperation($dms, $document, $user, $settings);
|
||||
$accessop = new SeedDMS_AccessOperation($dms, $user, $settings);
|
||||
|
||||
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
|
||||
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user, 'folder'=>$folder, 'document'=>$document, 'target'=>$target));
|
||||
|
|
|
@ -62,7 +62,7 @@ if ($overallStatus["status"] == S_REJECTED || $overallStatus["status"] == S_EXPI
|
|||
$folder = $document->getFolder();
|
||||
|
||||
/* Create object for checking access to certain operations */
|
||||
$accessop = new SeedDMS_AccessOperation($dms, $document, $user, $settings);
|
||||
$accessop = new SeedDMS_AccessOperation($dms, $user, $settings);
|
||||
|
||||
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
|
||||
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user, 'folder'=>$folder, 'document'=>$document, 'version'=>$content));
|
||||
|
|
|
@ -59,10 +59,10 @@ if ($latestContent->getVersion()!=$version) {
|
|||
UI::exitError(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName()))),getMLText("invalid_version"));
|
||||
}
|
||||
/* Create object for checking access to certain operations */
|
||||
$accessop = new SeedDMS_AccessOperation($dms, $document, $user, $settings);
|
||||
$accessop = new SeedDMS_AccessOperation($dms, $user, $settings);
|
||||
|
||||
// verify if document may be receipted
|
||||
if (!$accessop->mayReceipt()){
|
||||
if (!$accessop->mayReceipt($document)){
|
||||
UI::exitError(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName()))),getMLText("access_denied"));
|
||||
}
|
||||
|
||||
|
|
|
@ -51,7 +51,7 @@ if($document->isLocked()) {
|
|||
$folder = $document->getFolder();
|
||||
|
||||
/* Create object for checking access to certain operations */
|
||||
$accessop = new SeedDMS_AccessOperation($dms, $document, $user, $settings);
|
||||
$accessop = new SeedDMS_AccessOperation($dms, $user, $settings);
|
||||
|
||||
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
|
||||
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user, 'folder'=>$folder, 'document'=>$document));
|
||||
|
|
|
@ -53,7 +53,7 @@ if (($document->getAccessMode($user) < M_ALL)&&($user->getID()!=$file->getUserID
|
|||
$folder = $document->getFolder();
|
||||
|
||||
/* Create object for checking access to certain operations */
|
||||
$accessop = new SeedDMS_AccessOperation($dms, $document, $user, $settings);
|
||||
$accessop = new SeedDMS_AccessOperation($dms, $user, $settings);
|
||||
|
||||
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
|
||||
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user, 'folder'=>$folder, 'document'=>$document, 'file'=>$file));
|
||||
|
|
|
@ -60,7 +60,7 @@ if (!is_object($version)) {
|
|||
$folder = $document->getFolder();
|
||||
|
||||
/* Create object for checking access to certain operations */
|
||||
$accessop = new SeedDMS_AccessOperation($dms, $document, $user, $settings);
|
||||
$accessop = new SeedDMS_AccessOperation($dms, $user, $settings);
|
||||
|
||||
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
|
||||
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user, 'folder'=>$folder, 'document'=>$document, 'version'=>$version));
|
||||
|
|
|
@ -60,7 +60,7 @@ if (!is_object($workflow)) {
|
|||
$folder = $document->getFolder();
|
||||
|
||||
/* Create object for checking access to certain operations */
|
||||
$accessop = new SeedDMS_AccessOperation($dms, $document, $user, $settings);
|
||||
$accessop = new SeedDMS_AccessOperation($dms, $user, $settings);
|
||||
|
||||
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
|
||||
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user, 'folder'=>$folder, 'document'=>$document, 'version'=>$version));
|
||||
|
|
|
@ -60,10 +60,10 @@ if ($latestContent->getVersion()!=$version) {
|
|||
}
|
||||
|
||||
/* Create object for checking access to certain operations */
|
||||
$accessop = new SeedDMS_AccessOperation($dms, $document, $user, $settings);
|
||||
$accessop = new SeedDMS_AccessOperation($dms, $user, $settings);
|
||||
|
||||
// verify if document may be reviewed
|
||||
if (!$accessop->mayReview()){
|
||||
if (!$accessop->mayReview($document)){
|
||||
UI::exitError(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName()))),getMLText("access_denied"));
|
||||
}
|
||||
|
||||
|
|
|
@ -60,7 +60,7 @@ if ($latestContent->getVersion()!=$version) {
|
|||
}
|
||||
|
||||
/* Create object for checking access to certain operations */
|
||||
$accessop = new SeedDMS_AccessOperation($dms, $document, $user, $settings);
|
||||
$accessop = new SeedDMS_AccessOperation($dms, $user, $settings);
|
||||
|
||||
// verify if document maybe revised
|
||||
if (!$document->mayRevise()){
|
||||
|
|
|
@ -60,7 +60,7 @@ if (!is_object($workflow)) {
|
|||
$folder = $document->getFolder();
|
||||
|
||||
/* Create object for checking access to certain operations */
|
||||
$accessop = new SeedDMS_AccessOperation($dms, $document, $user, $settings);
|
||||
$accessop = new SeedDMS_AccessOperation($dms, $user, $settings);
|
||||
|
||||
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
|
||||
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user, 'folder'=>$folder, 'document'=>$document, 'version'=>$version));
|
||||
|
|
|
@ -65,7 +65,7 @@ if (!is_object($subworkflow)) {
|
|||
$folder = $document->getFolder();
|
||||
|
||||
/* Create object for checking access to certain operations */
|
||||
$accessop = new SeedDMS_AccessOperation($dms, $document, $user, $settings);
|
||||
$accessop = new SeedDMS_AccessOperation($dms, $user, $settings);
|
||||
|
||||
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
|
||||
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user, 'folder'=>$folder, 'document'=>$document, 'version'=>$version, 'subworkflow'=>$subworkflow));
|
||||
|
|
|
@ -44,7 +44,7 @@ if ($document->getAccessMode($user) < M_READWRITE) {
|
|||
$folder = $document->getFolder();
|
||||
|
||||
/* Create object for checking access to certain operations */
|
||||
$accessop = new SeedDMS_AccessOperation($dms, $document, $user, $settings);
|
||||
$accessop = new SeedDMS_AccessOperation($dms, $user, $settings);
|
||||
|
||||
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
|
||||
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user, 'folder'=>$folder, 'document'=>$document));
|
||||
|
|
|
@ -58,7 +58,7 @@ if(!$settings->_enableVersionModification) {
|
|||
$folder = $document->getFolder();
|
||||
|
||||
/* Create object for checking access to certain operations */
|
||||
$accessop = new SeedDMS_AccessOperation($dms, $document, $user, $settings);
|
||||
$accessop = new SeedDMS_AccessOperation($dms, $user, $settings);
|
||||
|
||||
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
|
||||
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user, 'folder'=>$folder, 'document'=>$document, 'version'=>$content, 'enableadminrevapp'=>$settings->_enableAdminRevApp, 'enableownerrevapp'=>$settings->_enableOwnerRevApp, 'enableselfrevapp'=>$settings->_enableSelfRevApp));
|
||||
|
|
|
@ -55,8 +55,8 @@ if(!$settings->_enableVersionModification) {
|
|||
}
|
||||
|
||||
/* Create object for checking access to certain operations */
|
||||
$accessop = new SeedDMS_AccessOperation($dms, $document, $user, $settings);
|
||||
if (!$accessop->maySetReviewersApprovers()) {
|
||||
$accessop = new SeedDMS_AccessOperation($dms, $user, $settings);
|
||||
if (!$accessop->maySetReviewersApprovers($document)) {
|
||||
UI::exitError(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName()))),getMLText("cannot_assign_invalid_state"));
|
||||
}
|
||||
|
||||
|
|
|
@ -58,7 +58,7 @@ if(!$settings->_enableVersionModification) {
|
|||
$folder = $document->getFolder();
|
||||
|
||||
/* Create object for checking access to certain operations */
|
||||
$accessop = new SeedDMS_AccessOperation($dms, $document, $user, $settings);
|
||||
$accessop = new SeedDMS_AccessOperation($dms, $user, $settings);
|
||||
|
||||
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
|
||||
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user, 'folder'=>$folder, 'document'=>$document, 'version'=>$content));
|
||||
|
|
|
@ -51,7 +51,7 @@ if (!is_object($version)) {
|
|||
$folder = $document->getFolder();
|
||||
|
||||
/* Create object for checking access to certain operations */
|
||||
$accessop = new SeedDMS_AccessOperation($dms, $document, $user, $settings);
|
||||
$accessop = new SeedDMS_AccessOperation($dms, $user, $settings);
|
||||
|
||||
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
|
||||
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user, 'folder'=>$folder, 'document'=>$document, 'version'=>$version));
|
||||
|
|
|
@ -61,7 +61,7 @@ if (!is_object($transition)) {
|
|||
$folder = $document->getFolder();
|
||||
|
||||
/* Create object for checking access to certain operations */
|
||||
$accessop = new SeedDMS_AccessOperation($dms, $document, $user, $settings);
|
||||
$accessop = new SeedDMS_AccessOperation($dms, $user, $settings);
|
||||
|
||||
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
|
||||
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user, 'folder'=>$folder, 'document'=>$document, 'version'=>$version, 'transition'=>$transition));
|
||||
|
|
|
@ -58,7 +58,7 @@ if($settings->_quota > 0) {
|
|||
$folder = $document->getFolder();
|
||||
|
||||
/* Create object for checking access to certain operations */
|
||||
$accessop = new SeedDMS_AccessOperation($dms, $document, $user, $settings);
|
||||
$accessop = new SeedDMS_AccessOperation($dms, $user, $settings);
|
||||
|
||||
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
|
||||
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user, 'folder'=>$folder, 'document'=>$document, 'strictformcheck'=>$settings->_strictFormCheck, 'enablelargefileupload'=>$settings->_enableLargeFileUpload, 'enableadminrevapp'=>$settings->_enableAdminRevApp, 'enableownerrevapp'=>$settings->_enableOwnerRevApp, 'enableselfrevapp'=>$settings->_enableSelfRevApp, 'dropfolderdir'=>$settings->_dropFolderDir, 'workflowmode'=>$settings->_workflowMode, 'presetexpiration'=>$settings->_presetExpirationDate));
|
||||
|
|
|
@ -49,7 +49,7 @@ if (!is_object($document)) {
|
|||
}
|
||||
|
||||
/* Create object for checking access to certain operations */
|
||||
$accessop = new SeedDMS_AccessOperation($dms, $document, $user, $settings);
|
||||
$accessop = new SeedDMS_AccessOperation($dms, $user, $settings);
|
||||
|
||||
$folder = $document->getFolder();
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@ include("../inc/inc.Extension.php");
|
|||
include("../inc/inc.DBInit.php");
|
||||
include("../inc/inc.Authentication.php");
|
||||
include("../inc/inc.ClassUI.php");
|
||||
include("../inc/inc.ClassAcl.php");
|
||||
include("../inc/inc.ClassAccessOperation.php");
|
||||
|
||||
/**
|
||||
* Include class to preview documents
|
||||
|
@ -35,9 +35,10 @@ require_once("SeedDMS/Preview.php");
|
|||
|
||||
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
|
||||
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user));
|
||||
|
||||
//$aro = SeedDMS_Aro::getInstance($user->getRole(), $dms);
|
||||
//$aco = SeedDMS_Aco::getInstance('Views/'.$tmp[1], $dms);
|
||||
$accessop = new SeedDMS_AccessOperation($dms, $user, $settings);
|
||||
if(!$accessop->check_view_access($view, $_GET)) {
|
||||
UI::exitError("", getMLText("access_denied"));
|
||||
}
|
||||
|
||||
if (!isset($_GET["folderid"]) || !is_numeric($_GET["folderid"]) || intval($_GET["folderid"])<1) {
|
||||
$folderid = $settings->_rootFolderID;
|
||||
|
|
|
@ -579,7 +579,7 @@ $(document).ready(function () {
|
|||
$menuitems['move_document'] = array('link'=>"../out/out.MoveDocument".$docid, 'label'=>'move_document');
|
||||
}
|
||||
}
|
||||
if($this->params['accessobject']->maySetExpires()) {
|
||||
if($this->params['accessobject']->maySetExpires($document)) {
|
||||
$menuitems['expires'] = array('link'=>"../out/out.SetExpires".$docid, 'label'=>'expires');
|
||||
// $menuitems[''] = array('link'=>"", 'label'=>'');
|
||||
}
|
||||
|
|
|
@ -521,42 +521,42 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style {
|
|||
/* Only admin has the right to remove version in any case or a regular
|
||||
* user if enableVersionDeletion is on
|
||||
*/
|
||||
if($accessop->mayRemoveVersion()) {
|
||||
if($accessop->mayRemoveVersion($document)) {
|
||||
print "<li><a href=\"out.RemoveVersion.php?documentid=".$documentid."&version=".$latestContent->getVersion()."\"><i class=\"icon-remove\"></i>".getMLText("rm_version")."</a></li>";
|
||||
}
|
||||
if($accessop->mayOverrideStatus()) {
|
||||
if($accessop->mayOverrideStatus($document)) {
|
||||
print "<li><a href='../out/out.OverrideContentStatus.php?documentid=".$documentid."&version=".$latestContent->getVersion()."'><i class=\"icon-align-justify\"></i>".getMLText("change_status")."</a></li>";
|
||||
}
|
||||
if($accessop->maySetRecipients()) {
|
||||
if($accessop->maySetRecipients($document)) {
|
||||
print "<li><a href='../out/out.SetRecipients.php?documentid=".$documentid."&version=".$latestContent->getVersion()."'><i class=\"icon-check\"></i>".getMLText("change_recipients")."</a></li>";
|
||||
}
|
||||
if($accessop->maySetRevisors()) {
|
||||
if($accessop->maySetRevisors($document)) {
|
||||
print "<li><a href='../out/out.SetRevisors.php?documentid=".$documentid."&version=".$latestContent->getVersion()."'><i class=\"icon-refresh\"></i>".getMLText("change_revisors")."</a></li>";
|
||||
}
|
||||
if($workflowmode == 'traditional' || $workflowmode == 'traditional_only_approval') {
|
||||
// Allow changing reviewers/approvals only if not reviewed
|
||||
if($accessop->maySetReviewersApprovers()) {
|
||||
if($accessop->maySetReviewersApprovers($document)) {
|
||||
print "<li><a href='../out/out.SetReviewersApprovers.php?documentid=".$documentid."&version=".$latestContent->getVersion()."'><i class=\"icon-edit\"></i>".getMLText("change_assignments")."</a></li>";
|
||||
}
|
||||
} else {
|
||||
if($accessop->maySetWorkflow()) {
|
||||
if($accessop->maySetWorkflow($document)) {
|
||||
if(!$workflow) {
|
||||
print "<li><a href='../out/out.SetWorkflow.php?documentid=".$documentid."&version=".$latestContent->getVersion()."'><i class=\"icon-random\"></i>".getMLText("set_workflow")."</a></li>";
|
||||
}
|
||||
}
|
||||
}
|
||||
/*
|
||||
if($accessop->maySetExpires()) {
|
||||
if($accessop->maySetExpires($document)) {
|
||||
print "<li><a href='../out/out.SetExpires.php?documentid=".$documentid."'><i class=\"icon-time\"></i>".getMLText("set_expiry")."</a></li>";
|
||||
}
|
||||
*/
|
||||
if($dms->getAllTransmittals($user)) {
|
||||
print "<li><a href=\"out.AddToTransmittal.php?documentid=".$documentid."&version=".$latestContent->getVersion()."\"><i class=\"icon-list\"></i>".getMLText("add_to_transmittal")."</a></li>";
|
||||
}
|
||||
if($accessop->mayEditComment()) {
|
||||
if($accessop->mayEditComment($document)) {
|
||||
print "<li><a href=\"out.EditComment.php?documentid=".$documentid."&version=".$latestContent->getVersion()."\"><i class=\"icon-comment\"></i>".getMLText("edit_comment")."</a></li>";
|
||||
}
|
||||
if($accessop->mayEditAttributes()) {
|
||||
if($accessop->mayEditAttributes($document)) {
|
||||
print "<li><a href=\"out.EditAttributes.php?documentid=".$documentid."&version=".$latestContent->getVersion()."\"><i class=\"icon-edit\"></i>".getMLText("edit_attributes")."</a></li>";
|
||||
}
|
||||
|
||||
|
@ -676,7 +676,7 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style {
|
|||
print "<td>".getReviewStatusText($r["status"])."</td>\n";
|
||||
print "<td><ul class=\"unstyled\">";
|
||||
|
||||
if($accessop->mayReview()) {
|
||||
if($accessop->mayReview($document)) {
|
||||
if ($is_reviewer && $r["status"]==0) {
|
||||
print "<li><a href=\"../out/out.ReviewDocument.php?documentid=".$documentid."&version=".$latestContent->getVersion()."&reviewid=".$r['reviewID']."\" class=\"btn btn-mini\">".getMLText("add_review")."</a></li>";
|
||||
}else if (($updateUser==$user)&&(($r["status"]==1)||($r["status"]==-1))&&(!$document->hasExpired())){
|
||||
|
@ -745,7 +745,7 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style {
|
|||
print "<td>".getApprovalStatusText($a["status"])."</td>\n";
|
||||
print "<td><ul class=\"unstyled\">";
|
||||
|
||||
if($accessop->mayApprove()) {
|
||||
if($accessop->mayApprove($document)) {
|
||||
if ($is_approver && $a['status'] == 0 /*$status["status"]==S_DRAFT_APP*/) {
|
||||
print "<li><a class=\"btn btn-mini\" href=\"../out/out.ApproveDocument.php?documentid=".$documentid."&version=".$latestContent->getVersion()."&approveid=".$a['approveID']."\">".getMLText("add_approval")."</a></li>";
|
||||
}else if (($updateUser==$user)&&(($a["status"]==1)||($a["status"]==-1))&&(!$document->hasExpired())){
|
||||
|
@ -1028,7 +1028,7 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style {
|
|||
print "<td>".getReceiptStatusText($r["status"])."</td>\n";
|
||||
print "<td><ul class=\"unstyled\">";
|
||||
|
||||
if($accessop->mayReceipt()) {
|
||||
if($accessop->mayReceipt($document)) {
|
||||
if ($is_recipient && $r["status"]==0) {
|
||||
print "<li><a href=\"../out/out.ReceiptDocument.php?documentid=".$documentid."&version=".$latestContent->getVersion()."&receiptid=".$r['receiptID']."\" class=\"btn btn-mini\">".getMLText("add_receipt")."</a></li>";
|
||||
}else if (($updateUser==$user)&&(($r["status"]==1)||($r["status"]==-1))&&(!$document->hasExpired())){
|
||||
|
@ -1130,7 +1130,7 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style {
|
|||
print "<td>".getRevisionStatusText($r["status"])."</td>\n";
|
||||
print "<td><ul class=\"unstyled\">";
|
||||
|
||||
if($accessop->mayRevise()) {
|
||||
if($accessop->mayRevise($document)) {
|
||||
if ($is_recipient && $r["status"]==0) {
|
||||
print "<li><a href=\"../out/out.ReviseDocument.php?documentid=".$documentid."&version=".$latestContent->getVersion()."&revisionid=".$r['revisionID']."\" class=\"btn btn-mini\">".getMLText("add_revision")."</a></li>";
|
||||
} elseif (($updateUser==$user)&&(($r["status"]==1)||($r["status"]==-1))&&(!$document->hasExpired())){
|
||||
|
@ -1242,13 +1242,13 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style {
|
|||
/* Only admin has the right to remove version in any case or a regular
|
||||
* user if enableVersionDeletion is on
|
||||
*/
|
||||
if($accessop->mayRemoveVersion()) {
|
||||
if($accessop->mayRemoveVersion($document)) {
|
||||
print "<li><a href=\"out.RemoveVersion.php?documentid=".$documentid."&version=".$version->getVersion()."\"><i class=\"icon-remove\"></i>".getMLText("rm_version")."</a></li>";
|
||||
}
|
||||
if($accessop->mayEditComment()) {
|
||||
if($accessop->mayEditComment($document)) {
|
||||
print "<li><a href=\"out.EditComment.php?documentid=".$document->getID()."&version=".$version->getVersion()."\"><i class=\"icon-comment\"></i>".getMLText("edit_comment")."</a></li>";
|
||||
}
|
||||
if($accessop->mayEditAttributes()) {
|
||||
if($accessop->mayEditAttributes($document)) {
|
||||
print "<li><a href=\"out.EditAttributes.php?documentid=".$document->getID()."&version=".$latestContent->getVersion()."\"><i class=\"icon-edit\"></i>".getMLText("edit_attributes")."</a></li>";
|
||||
}
|
||||
print "<li><a href='../out/out.DocumentVersionDetail.php?documentid=".$documentid."&version=".$version->getVersion()."'><i class=\"icon-info-sign\"></i>".getMLText("details")."</a></li>";
|
||||
|
|
Loading…
Reference in New Issue
Block a user