Пример #1
0
 static function isActionGlobalAllowed($oUser, $sAction)
 {
     if (AnwAction::isAdminAction($sAction)) {
         $bReturn = self::isAdminAllowed($oUser);
     } else {
         if (AnwAction::isPublicAction($sAction)) {
             $bReturn = true;
         } else {
             if (AnwAction::isMagicAclAction($sAction)) {
                 return false;
                 //we should never go here, this test is just in case of...
             }
             $bReturn = self::getDriver()->isActionGlobalAllowed($oUser, $sAction) || self::isAdminAllowed($oUser);
             //admins have full rights everywhere
         }
     }
     return $bReturn;
 }
 function init()
 {
     parent::init();
     //actions page policy
     $oContentField = new AnwContentFieldSettings_radio(self::FIELD_POLICY);
     $asEnumValues = array(self::POLICY_ALL_ACTIONS => $this->getComponent()->t_contentfieldsettings("policy_all_actionspage"), self::POLICY_SELECTED_ACTIONS => $this->getComponent()->t_contentfieldsettings("policy_selected_actionspage"));
     $oContentField->setEnumValues($asEnumValues);
     $oContentField->setDefaultValue(self::POLICY_SELECTED_ACTIONS);
     $this->addContentField($oContentField);
     //actions page selection
     $oContentField = new AnwContentFieldSettings_checkboxGroup(self::FIELD_ACTIONS);
     $asActions = AnwComponent::getEnabledComponents(AnwComponent::TYPE_ACTION);
     $asEnumValues = array();
     foreach ($asActions as $sAction) {
         if (AnwAction::isActionPage($sAction) && !AnwAction::isMagicAclAction($sAction)) {
             $asEnumValues[$sAction] = $sAction;
         }
     }
     $oContentField->setEnumValues($asEnumValues);
     $oMultiplicity = new AnwContentMultiplicity_multiple();
     $oMultiplicity->setSortable(false);
     $oContentField->setMultiplicity($oMultiplicity);
     $this->addContentField($oContentField);
 }