1.5.00 fix permission control
This commit is contained in:
parent
63f7767460
commit
08fb2d25fd
@ -1755,12 +1755,12 @@ class course extends common
|
|||||||
*/
|
*/
|
||||||
public function permissionControl($funtion, $courseId)
|
public function permissionControl($funtion, $courseId)
|
||||||
{
|
{
|
||||||
switch (self::$actions[$funtion]) {
|
switch ($this->getUser('group') ) {
|
||||||
case self::GROUP_ADMIN:
|
case self::GROUP_ADMIN:
|
||||||
return ($this->getUser('group') === self::$actions[$funtion]);
|
return true;
|
||||||
case self::GROUP_EDITOR:
|
case self::GROUP_EDITOR:
|
||||||
return (
|
return (
|
||||||
$this->getUser('group') >= self::$actions[$funtion]
|
$this->getUser('group') === self::$actions[$funtion]
|
||||||
&& $this->getData(['enrolment', $courseId])
|
&& $this->getData(['enrolment', $courseId])
|
||||||
&& ($this->getUser('id') === $this->getData(['course', $courseId, 'author'])
|
&& ($this->getUser('id') === $this->getData(['course', $courseId, 'author'])
|
||||||
|| array_key_exists($this->getUser('id'), $this->getData(['enrolment', $courseId])) )
|
|| array_key_exists($this->getUser('id'), $this->getData(['enrolment', $courseId])) )
|
||||||
|
Loading…
Reference in New Issue
Block a user