예제 #1
0
 /**
  * Constructor
  * @param object $context the context this table relates to.
  * @param object $user the user we are generating the results for.
  * @param string $contextname $context->get_context_name() - to save recomputing.
  */
 public function __construct($context, $user, $contextname)
 {
     parent::__construct($context, 'explaincaps');
     $this->user = $user;
     $this->fullname = fullname($user);
     $this->contextname = $contextname;
     $this->stryes = get_string('yes');
     $this->strno = get_string('no');
 }
 /**
  * Constructor.
  * @param context $context the context this table relates to.
  * @param string $contextname $context->get_context_name() - to save recomputing.
  * @param array $allowoverrides
  * @param array $allowsafeoverrides
  * @param array $overridableroles
  */
 public function __construct($context, $contextname, $allowoverrides, $allowsafeoverrides, $overridableroles)
 {
     parent::__construct($context, 'permissions');
     $this->contextname = $contextname;
     $this->allowoverrides = $allowoverrides;
     $this->allowsafeoverrides = $allowsafeoverrides;
     $this->overridableroles = $overridableroles;
     $roles = get_all_roles($context);
     $this->roles = role_fix_names(array_reverse($roles, true), $context, ROLENAME_ALIAS, true);
 }
 public function display()
 {
     $this->load_parent_permissions();
     foreach ($this->capabilities as $cap) {
         if (!isset($this->parentpermissions[$cap->name])) {
             $this->parentpermissions[$cap->name] = CAP_INHERIT;
         }
     }
     parent::display();
 }