Skip to content

Commit

Permalink
Fix #52
Browse files Browse the repository at this point in the history
  • Loading branch information
tsmr committed Nov 5, 2022
1 parent eb7cbce commit fcde00a
Showing 1 changed file with 34 additions and 19 deletions.
53 changes: 34 additions & 19 deletions inc/taskstate.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,40 @@ class PluginTasklistsTaskState extends CommonDropdown {

static $rightname = 'plugin_tasklists_config';

/**
* Have I the global right to "create" the Object
* May be overloaded if needed (ex KnowbaseItem)
*
* @return boolean
**/
public static function canCreate() {
if (static::$rightname) {
return Session::haveRight(static::$rightname, READ);
}
return false;
}

public static function canUpdate() {
if (static::$rightname) {
return Session::haveRight(static::$rightname, READ);
}
return false;
}

public static function canDelete() {
if (static::$rightname) {
return Session::haveRight(static::$rightname, READ);
}
return false;
}

public static function canPurge()
{
if (static::$rightname) {
return Session::haveRight(static::$rightname, READ);
}
return false;
}

/**
* @param int $nb
Expand Down Expand Up @@ -315,23 +349,4 @@ function getFinishedState() {
*
* @return boolean
**/
static function canCreate() {
if (static::$rightname) {
return Session::haveRight(static::$rightname, 1);
}
return false;
}
static function canUpdate() {
if (static::$rightname) {
return Session::haveRight(static::$rightname, 1);
}
return false;
}

static function canDelete() {
if (static::$rightname) {
return Session::haveRight(static::$rightname, 1);
}
return false;
}
}

0 comments on commit fcde00a

Please sign in to comment.