当前位置: 首页>>代码示例>>PHP>>正文


PHP ACL::update_rights_to_base方法代码示例

本文整理汇总了PHP中ACL::update_rights_to_base方法的典型用法代码示例。如果您正苦于以下问题:PHP ACL::update_rights_to_base方法的具体用法?PHP ACL::update_rights_to_base怎么用?PHP ACL::update_rights_to_base使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ACL的用法示例。


在下文中一共展示了ACL::update_rights_to_base方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: testHas_access_to_module

 public function testHas_access_to_module()
 {
     foreach (self::$DI['app']['phraseanet.appbox']->get_databoxes() as $databox) {
         $base_ids = [];
         foreach ($databox->get_collections() as $collection) {
             $base_id = $collection->get_base_id();
             $base_ids[] = $base_id;
         }
         self::$object->revoke_access_from_bases($base_ids);
         self::$object->revoke_unused_sbas_rights();
     }
     if (self::$object->is_admin()) {
         $this->assertTrue(self::$object->has_access_to_module('admin'));
     } else {
         $this->assertFalse(self::$object->has_access_to_module('admin'));
     }
     $this->assertFalse(self::$object->has_access_to_module('thesaurus'));
     $this->assertFalse(self::$object->has_access_to_module('upload'));
     $this->assertFalse(self::$object->has_access_to_module('report'));
     $found = false;
     foreach (self::$DI['app']['phraseanet.appbox']->get_databoxes() as $databox) {
         foreach ($databox->get_collections() as $collection) {
             $base_id = $collection->get_base_id();
             $base_ids[] = $base_id;
             self::$object->update_rights_to_base($base_id, ['canreport' => true]);
             $found = true;
             break;
         }
         if ($found) {
             break;
         }
     }
     $this->assertTrue(self::$object->has_access_to_module('report'));
     $this->assertFalse(self::$object->has_access_to_module('thesaurus'));
     $this->assertFalse(self::$object->has_access_to_module('upload'));
     foreach (self::$DI['app']['phraseanet.appbox']->get_databoxes() as $databox) {
         self::$object->update_rights_to_sbas($databox->get_sbas_id(), ['bas_modif_th' => true]);
         $found = true;
     }
     $this->assertTrue(self::$object->has_access_to_module('report'));
     $this->assertTrue(self::$object->has_access_to_module('thesaurus'));
     $this->assertFalse(self::$object->has_access_to_module('upload'));
     $found = false;
     foreach (self::$DI['app']['phraseanet.appbox']->get_databoxes() as $databox) {
         foreach ($databox->get_collections() as $collection) {
             $base_id = $collection->get_base_id();
             $base_ids[] = $base_id;
             self::$object->update_rights_to_base($base_id, ['canaddrecord' => true]);
             $found = true;
             break;
         }
         if ($found) {
             break;
         }
     }
     $this->assertTrue(self::$object->has_access_to_module('report'));
     $this->assertTrue(self::$object->has_access_to_module('thesaurus'));
     $this->assertTrue(self::$object->has_access_to_module('upload'));
 }
开发者ID:nlegoff,项目名称:Phraseanet,代码行数:59,代码来源:ACLTest.php

示例2: doResetRightsOnCollection

 /**
  * Resets admin rights on a collection.
  *
  * @param \ACL        $acl
  * @param \collection $collection
  */
 private function doResetRightsOnCollection(\ACL $acl, \collection $collection)
 {
     $baseId = $collection->get_base_id();
     $acl->set_limits($baseId, false);
     $acl->remove_quotas_on_base($baseId);
     $acl->set_masks_on_base($baseId, '0', '0', '0', '0');
     $acl->update_rights_to_base($baseId, ['canputinalbum' => '1', 'candwnldhd' => '1', 'candwnldsubdef' => '1', 'nowatermark' => '1', 'candwnldpreview' => '1', 'cancmd' => '1', 'canadmin' => '1', 'canreport' => '1', 'canpush' => '1', 'creationdate' => '1', 'canaddrecord' => '1', 'canmodifrecord' => '1', 'candeleterecord' => '1', 'chgstatus' => '1', 'imgtools' => '1', 'manage' => '1', 'modify_struct' => '1', 'bas_modify_struct' => '1']);
 }
开发者ID:luisbrito,项目名称:Phraseanet,代码行数:14,代码来源:ACLManipulator.php


注:本文中的ACL::update_rights_to_base方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。