Example #1
0
 /**
  * Constructor
  *
  * This method loads loads all the information about the current state of
  * the overrides, then updates that based on any submitted data. It also
  * works out which capabilities should be locked for this user.
  *
  * @param object $context the context this table relates to.
  * @param integer $roleid the role being overridden.
  * @param boolean $safeoverridesonly If true, the user is only allowed to override
  *      capabilities with no risks.
  */
 public function __construct($context, $roleid, $safeoverridesonly)
 {
     parent::__construct($context, 'overriderolestable', $roleid);
     $this->displaypermissions = $this->allpermissions;
     $this->strnotset = get_string('notset', 'role');
     /// Determine which capabilities should be locked.
     if ($safeoverridesonly) {
         foreach ($this->capabilities as $capid => $cap) {
             if (!is_safe_capability($cap)) {
                 $this->capabilities[$capid]->locked = true;
                 $this->haslockedcapabilities = true;
             }
         }
     }
 }