本文整理汇总了PHP中AllPermissionsOptimizationUtil::rebuild方法的典型用法代码示例。如果您正苦于以下问题:PHP AllPermissionsOptimizationUtil::rebuild方法的具体用法?PHP AllPermissionsOptimizationUtil::rebuild怎么用?PHP AllPermissionsOptimizationUtil::rebuild使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AllPermissionsOptimizationUtil
的用法示例。
在下文中一共展示了AllPermissionsOptimizationUtil::rebuild方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setUpBeforeClass
public static function setUpBeforeClass()
{
parent::setUpBeforeClass();
SecurityTestHelper::createSuperAdmin();
$super = User::getByUsername('super');
Yii::app()->user->userModel = $super;
AllPermissionsOptimizationUtil::rebuild();
//Add the nobody user to an account, but only read only.
$nobody = User::getByUsername('nobody');
$account = AccountTestHelper::createAccountByNameForOwner('superAccountReadableByNobody', Yii::app()->user->userModel);
$account->addPermissions($nobody, Permission::READ, Permission::ALLOW);
assert($account->save());
// Not Coding Standard
AllPermissionsOptimizationUtil::securableItemGivenPermissionsForUser($account, $nobody);
//Give the nobody user rights to the accounts module.
$nobody->setRight('AccountsModule', AccountsModule::RIGHT_ACCESS_ACCOUNTS);
$nobody->setRight('AccountsModule', AccountsModule::RIGHT_CREATE_ACCOUNTS);
assert($nobody->save());
// Not Coding Standard
$everyoneGroup = Group::getByName(Group::EVERYONE_GROUP_NAME);
assert($everyoneGroup->save());
// Not Coding Standard
$group1 = new Group();
$group1->name = 'Group1';
assert($group1->save());
// Not Coding Standard
}
示例2: setUpBeforeClass
public static function setUpBeforeClass()
{
parent::setUpBeforeClass();
SecurityTestHelper::createSuperAdmin();
SecurityTestHelper::createUsers();
$super = User::getByUsername('super');
$super->primaryEmail->emailAddress = 'super@zurmo.org';
$saved = $super->save();
if (!$saved) {
throw new FailedToSaveModelException();
}
MarketingListTestHelper::createMarketingListByName('testMarketingList');
$campaign = CampaignTestHelper::createCampaign('testCampaign', 'testSubject', 'testContent', 'testHtmlContent');
$contact = ContactTestHelper::createContactByNameForOwner('test', $super);
$emailMessage = EmailMessageTestHelper::createArchivedUnmatchedSentMessage($super);
$campaignItem = new CampaignItem();
$campaignItem->contact = $contact;
$campaignItem->processed = true;
$campaignItem->campaign = $campaign;
$campaignItem->emailMessage = $emailMessage;
$campaignItem->unrestrictedSave();
if (!$saved) {
throw new FailedToSaveModelException();
}
AllPermissionsOptimizationUtil::rebuild();
}
示例3: setUpBeforeClass
public static function setUpBeforeClass()
{
parent::setUpBeforeClass();
SecurityTestHelper::createSuperAdmin();
$nobody = UserTestHelper::createBasicUser('nobody');
$nobody->setRight('MarketingListsModule', MarketingListsModule::getAccessRight());
$saved = $nobody->save();
static::assertTrue($saved);
Yii::app()->user->userModel = $nobody;
//Setup test data owned by the super user.
$account = AccountTestHelper::createAccountByNameForOwner('nobodyAccount', $nobody);
$marketingList1 = MarketingListTestHelper::createMarketingListByName('MarketingList1', 'MarketingList Description1');
$marketingList2 = MarketingListTestHelper::createMarketingListByName('MarketingList2', 'MarketingList Description2');
for ($i = 0; $i < 17; $i++) {
if ($i % 2) {
$unsubscribed = 0;
} else {
$unsubscribed = 1;
}
$contact1 = ContactTestHelper::createContactWithAccountByNameForOwner('nobodyContact1' . $i, $nobody, $account);
$contact2 = ContactTestHelper::createContactWithAccountByNameForOwner('nobodyContact2' . $i, $nobody, $account);
MarketingListMemberTestHelper::createMarketingListMember($unsubscribed, $marketingList1, $contact1);
MarketingListMemberTestHelper::createMarketingListMember($unsubscribed, $marketingList2, $contact2);
}
AllPermissionsOptimizationUtil::rebuild();
}
开发者ID:RamaKavanan,项目名称:InitialVersion,代码行数:26,代码来源:MarketingListMemberControllerRegularUserWalkthroughTest.php
示例4: setUpBeforeClass
public static function setUpBeforeClass()
{
parent::setUpBeforeClass();
SecurityTestHelper::createSuperAdmin();
Yii::app()->user->userModel = User::getByUsername('super');
AllPermissionsOptimizationUtil::rebuild();
SecurityTestHelper::createUsers();
$billy = User::getByUsername('billy');
EmailMessageTestHelper::createEmailAccount($billy);
$billy->setRight('ContactsModule', ContactsModule::RIGHT_ACCESS_CONTACTS);
$billy->setRight('ContactsModule', ContactsModule::RIGHT_CREATE_CONTACTS);
$billy->setRight('ContactsModule', ContactsModule::RIGHT_DELETE_CONTACTS);
assert($billy->save());
// Not Coding Standard
$contact = ContactTestHelper::createContactByNameForOwner('sally', Yii::app()->user->userModel);
$contact->primaryEmail = new Email();
$contact->primaryEmail->emailAddress = 'sally@zurmoland.com';
$contact->secondaryEmail->emailAddress = 'toMakeSureNoFreeze@works.com';
$contact->addPermissions($billy, Permission::READ);
$contact->addPermissions($billy, Permission::WRITE);
$contact->save();
$molly = ContactTestHelper::createContactByNameForOwner('molly', User::getByUsername('bobby'));
$molly->primaryEmail = new Email();
$molly->primaryEmail->emailAddress = 'molly@zurmoland.com';
$molly->secondaryEmail->emailAddress = 'toMakeSureNoFreeze@works.zur';
$molly->save();
AllPermissionsOptimizationUtil::securableItemGivenPermissionsForUser($contact, $billy);
}
示例5: setUpBeforeClass
public static function setUpBeforeClass()
{
parent::setUpBeforeClass();
AllPermissionsOptimizationUtil::rebuild();
SecurityTestHelper::createSuperAdmin();
$everyoneGroup = Group::getByName(Group::EVERYONE_GROUP_NAME);
assert($everyoneGroup->save());
// Not Coding Standard
$group1 = new Group();
$group1->name = 'Group1';
assert($group1->save());
// Not Coding Standard
$group2 = new Group();
$group2->name = 'Group2';
assert($group2->save());
// Not Coding Standard
$group3 = new Group();
$group3->name = 'Group3';
assert($group3->save());
// Not Coding Standard
$group4 = new Group();
$group4->name = 'Group4';
assert($group4->save());
// Not Coding Standard
}
示例6: setUpBeforeClass
public static function setUpBeforeClass()
{
parent::setUpBeforeClass();
SecurityTestHelper::createSuperAdmin();
SecurityTestHelper::createUsers();
$super = User::getByUsername('super');
Yii::app()->user->userModel = $super;
//Setup test data owned by the super user.
$account = AccountTestHelper::createAccountByNameForOwner('superAccount', $super);
$account2 = AccountTestHelper::createAccountByNameForOwner('superAccount2', $super);
$contact1 = ContactTestHelper::createContactWithAccountByNameForOwner('superContact', $super, $account);
$contact2 = ContactTestHelper::createContactWithAccountByNameForOwner('superContact2', $super, $account2);
$contact3 = ContactTestHelper::createContactWithAccountByNameForOwner('superContact3', $super, $account);
$contact4 = ContactTestHelper::createContactWithAccountByNameForOwner('superContact4', $super, $account2);
$contact5 = ContactTestHelper::createContactWithAccountByNameForOwner('superContact5', $super, $account);
$marketingList1 = MarketingListTestHelper::createMarketingListByName('MarketingList1', 'MarketingList Description1');
$marketingList2 = MarketingListTestHelper::createMarketingListByName('MarketingList2', 'MarketingList Description2');
MarketingListMemberTestHelper::createMarketingListMember(0, $marketingList1, $contact1);
MarketingListMemberTestHelper::createMarketingListMember(1, $marketingList1, $contact2);
MarketingListMemberTestHelper::createMarketingListMember(0, $marketingList1, $contact3);
MarketingListMemberTestHelper::createMarketingListMember(1, $marketingList1, $contact4);
MarketingListMemberTestHelper::createMarketingListMember(0, $marketingList1, $contact5);
MarketingListMemberTestHelper::createMarketingListMember(0, $marketingList2, $contact1);
MarketingListMemberTestHelper::createMarketingListMember(1, $marketingList2, $contact2);
AllPermissionsOptimizationUtil::rebuild();
}
开发者ID:RamaKavanan,项目名称:InitialVersion,代码行数:26,代码来源:MarketingListDefaultPortletControllerSuperUserWalkthroughTest.php
示例7: setUpBeforeClass
public static function setUpBeforeClass()
{
parent::setUpBeforeClass();
SecurityTestHelper::createSuperAdmin();
AllPermissionsOptimizationUtil::rebuild();
$everyoneGroup = Group::getByName(Group::EVERYONE_GROUP_NAME);
$everyoneGroup->save();
$super = User::getByUsername('super');
//Steven have access to missions module
$steven = UserTestHelper::createBasicUser('steven');
$steven->setRight('MissionsModule', MissionsModule::RIGHT_ACCESS_MISSIONS);
$steven->save();
//Jack dont have acess to missions module
$jack = UserTestHelper::createBasicUser('jack');
$mission = new Mission();
$mission->owner = $super;
$mission->takenByUser = $steven;
$mission->description = 'My test description';
$mission->reward = 'My test reward';
$mission->status = Mission::STATUS_AVAILABLE;
$mission->addPermissions($everyoneGroup, Permission::READ_WRITE);
assert($mission->save());
// Not Coding Standard
AllPermissionsOptimizationUtil::securableItemGivenPermissionsForGroup($mission, $everyoneGroup);
}
示例8: setUpBeforeClass
public static function setUpBeforeClass()
{
parent::setUpBeforeClass();
SecurityTestHelper::createSuperAdmin();
AllPermissionsOptimizationUtil::rebuild();
$box = EmailBox::resolveAndGetByName(EmailBox::NOTIFICATIONS_NAME);
}
示例9: setUpBeforeClass
public static function setUpBeforeClass()
{
parent::setUpBeforeClass();
SecurityTestHelper::createSuperAdmin();
SecurityTestHelper::createUsers();
// set up data owned by super
Yii::app()->user->userModel = User::getByUsername('super');
$account1 = AccountTestHelper::createAccountByNameForOwner('account1', Yii::app()->user->userModel);
$contact1 = ContactTestHelper::createContactWithAccountByNameForOwner('contact1', Yii::app()->user->userModel, $account1);
$contact2 = ContactTestHelper::createContactWithAccountByNameForOwner('contact2', Yii::app()->user->userModel, $account1);
$contact3 = ContactTestHelper::createContactWithAccountByNameForOwner('contact3', Yii::app()->user->userModel, $account1);
$marketingList1 = MarketingListTestHelper::createMarketingListByName('MarketingList1');
MarketingListMemberTestHelper::createMarketingListMember(0, $marketingList1, $contact1);
MarketingListMemberTestHelper::createMarketingListMember(1, $marketingList1, $contact2);
$member1 = MarketingListMemberTestHelper::createMarketingListMember(0, $marketingList1, $contact3);
static::$superUserMarketingListId = $marketingList1->id;
static::$superUserMemberId = $member1->id;
// set up data owned by nobody
Yii::app()->user->userModel = UserTestHelper::createBasicUser('nobody');
$account2 = AccountTestHelper::createAccountByNameForOwner('account2', Yii::app()->user->userModel);
$contact4 = ContactTestHelper::createContactWithAccountByNameForOwner('contact4', Yii::app()->user->userModel, $account2);
$contact5 = ContactTestHelper::createContactWithAccountByNameForOwner('contact5', Yii::app()->user->userModel, $account2);
$contact6 = ContactTestHelper::createContactWithAccountByNameForOwner('contact6', Yii::app()->user->userModel, $account2);
$marketingList2 = MarketingListTestHelper::createMarketingListByName('MarketingList2');
MarketingListMemberTestHelper::createMarketingListMember(0, $marketingList2, $contact4);
$member2 = MarketingListMemberTestHelper::createMarketingListMember(1, $marketingList2, $contact5);
MarketingListMemberTestHelper::createMarketingListMember(0, $marketingList2, $contact6);
static::$regularUserMarketingListId = $marketingList2->id;
static::$regularUserMemberId = $member2->id;
AllPermissionsOptimizationUtil::rebuild();
}
开发者ID:RamaKavanan,项目名称:InitialVersion,代码行数:31,代码来源:MarketingListDefaultPortletControllerRegularUserWalkthroughTest.php
示例10: setUpBeforeClass
public static function setUpBeforeClass()
{
parent::setUpBeforeClass();
SecurityTestHelper::createSuperAdmin();
self::$asynchronousThreshold = ExportModule::$asynchronousThreshold;
ExportModule::$asynchronousThreshold = 3;
AllPermissionsOptimizationUtil::rebuild();
}
示例11: setUpBeforeClass
public static function setUpBeforeClass()
{
parent::setUpBeforeClass();
SecurityTestHelper::createSuperAdmin();
$super = User::getByUsername('super');
Yii::app()->user->userModel = $super;
AllPermissionsOptimizationUtil::rebuild();
}
开发者ID:maruthisivaprasad,项目名称:zurmo,代码行数:8,代码来源:MarketingListDefaultControllerSuperUserWalkthroughTest.php
示例12: actionRebuildMunge
public function actionRebuildMunge()
{
AllPermissionsOptimizationUtil::rebuild();
echo Zurmo::t('ZurmoModule', 'All permissions rebuild complete.') . "<BR>";
if (SHOW_QUERY_DATA) {
echo PageView::makeShowQueryDataContent();
}
}
示例13: setUpBeforeClass
public static function setUpBeforeClass()
{
parent::setUpBeforeClass();
ZurmoDatabaseCompatibilityUtil::dropStoredFunctionsAndProcedures();
Yii::app()->user->userModel = SecurityTestHelper::createSuperAdmin();
SecurityTestHelper::createUsers();
AllPermissionsOptimizationUtil::rebuild();
}
示例14: setUpBeforeClass
public static function setUpBeforeClass()
{
parent::setUpBeforeClass();
//Setup test data owned by the super user.
$account = AccountTestHelper::createAccountByNameForOwner('superAccount', Yii::app()->user->userModel);
self::$asynchronousThreshold = ExportModule::$asynchronousThreshold;
ExportModule::$asynchronousThreshold = 3;
AllPermissionsOptimizationUtil::rebuild();
}
示例15: setUpBeforeClass
public static function setUpBeforeClass()
{
parent::setUpBeforeClass();
SecurityTestHelper::createSuperAdmin();
$super = User::getByUsername('super');
Yii::app()->user->userModel = $super;
UserTestHelper::createBasicUser('nobody');
static::$listOwnedBySuper = MarketingListTestHelper::createMarketingListByName('MarketingListName', 'MarketingList Description');
AllPermissionsOptimizationUtil::rebuild();
}
开发者ID:RamaKavanan,项目名称:InitialVersion,代码行数:10,代码来源:MarketingListDefaultControllerRegularUserWalkthroughTest.php