-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement Required (CO-2134) and Crosscheck (CO-1763) on RuleAttribute
- Loading branch information
Benn Oshrin
committed
Aug 2, 2021
1 parent
d772dba
commit 1ec6b4d
Showing
28 changed files
with
484 additions
and
165 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,69 @@ | ||
| <?php | ||
| /** | ||
| * COmanage Match Rule Attributes Mappings Controller | ||
| * | ||
| * Portions licensed to the University Corporation for Advanced Internet | ||
| * Development, Inc. ("UCAID") under one or more contributor license agreements. | ||
| * See the NOTICE file distributed with this work for additional information | ||
| * regarding copyright ownership. | ||
| * | ||
| * UCAID licenses this file to you under the Apache License, Version 2.0 | ||
| * (the "License"); you may not use this file except in compliance with the | ||
| * License. You may obtain a copy of the License at: | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| * | ||
| * @link https://www.internet2.edu/comanage COmanage Project | ||
| * @package match | ||
| * @since COmanage Match v1.0.0 | ||
| * @license Apache License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0) | ||
| */ | ||
|
|
||
| declare(strict_types = 1); | ||
|
|
||
| namespace App\Controller; | ||
|
|
||
| class RuleAttributesController extends StandardController { | ||
| public $pagination = [ | ||
| 'order' => [ | ||
| 'Attributes.name' => 'asc' | ||
| ], | ||
| // 'sortWhitelist' is renamed 'sortableFields' in Cake 4.1 | ||
| // 'sortableFields' => [ | ||
| 'sortWhitelist' => [ | ||
| 'Attributes.name' | ||
| ] | ||
| ]; | ||
|
|
||
| /** | ||
| * Authorization for this Controller, called by Auth component | ||
| * - postcondition: $vv_permissions set with calculated permissions for this Controller | ||
| * | ||
| * @since COmanage Match v1.0.0 | ||
| * @param Array $user Array of user data | ||
| * @return Boolean True if authorized for the current action, false otherwise | ||
| */ | ||
|
|
||
| public function isAuthorized(Array $user) { | ||
| $platformAdmin = $this->Authorization->isPlatformAdmin($user['username']); | ||
|
|
||
| $mgAdmin = $this->Authorization->isMatchAdmin($user['username'], $this->cur_mg->id); | ||
|
|
||
| $p = [ | ||
| 'add' => $platformAdmin || $mgAdmin, | ||
| 'delete' => $platformAdmin || $mgAdmin, | ||
| 'edit' => $platformAdmin || $mgAdmin, | ||
| 'index' => $platformAdmin || $mgAdmin, | ||
| 'view' => false | ||
| ]; | ||
|
|
||
| $this->set('vv_permissions', $p); | ||
| return $p[$this->request->getParam('action')]; | ||
| } | ||
| } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.