-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #102 from 5pm-HDH/permission-request
Permission request
- Loading branch information
Showing
28 changed files
with
2,862 additions
and
13 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
# Permission API | ||
|
||
## Internal Group Permission | ||
|
||
```php | ||
use CTApi\CTConfig; | ||
use CTApi\Requests\PermissionRequest; | ||
|
||
$internalGroupPermission = PermissionRequest::forGroup(21)->get(); | ||
|
||
var_dump( $internalGroupPermission->getSeeGroupTags()); | ||
// Output: true | ||
|
||
var_dump( $internalGroupPermission->getAddPerson()); | ||
// Output: true | ||
|
||
var_dump( $internalGroupPermission->getMailGroupMembers()); | ||
// Output: true | ||
|
||
// ... see InternalGroupPermission-Model | ||
|
||
``` | ||
|
||
## Internal Person Permission | ||
|
||
```php | ||
use CTApi\CTConfig; | ||
use CTApi\Requests\PermissionRequest; | ||
|
||
$internalPersonPermission = PermissionRequest::forPerson(23)->get(); | ||
|
||
var_dump( $internalPersonPermission->getSeePersons()); | ||
// Output: 2 | ||
|
||
var_dump( $internalPersonPermission->getInvitePerson()); | ||
// Output: true | ||
|
||
var_dump( $internalPersonPermission->getSeeTags()); | ||
// Output: true | ||
|
||
var_dump( $internalPersonPermission->getEditPersons()); | ||
// Output: true | ||
|
||
var_dump( $internalPersonPermission->getDoFollowup()); | ||
// Output: true | ||
|
||
|
||
``` | ||
|
||
## Global Permission (for logged in user) | ||
|
||
```php | ||
use CTApi\CTConfig; | ||
use CTApi\Requests\PermissionRequest; | ||
|
||
$globalPermission = PermissionRequest::myPermissions()->get(); | ||
|
||
var_dump( $globalPermission->getChurchcore()?->getAdministerSettings()); | ||
// Output: true | ||
|
||
var_dump( $globalPermission->getChurchdb()?->getViewBirthdaylist()); | ||
// Output: false | ||
|
||
var_dump( $globalPermission->getChurchcal()?->getView()); | ||
// Output: true | ||
|
||
var_dump( $globalPermission->getChurchresource()?->getCreateVirtualBookings()); | ||
// Output: false | ||
|
||
var_dump( $globalPermission->getChurchservice()?->getEditTemplate()); | ||
// Output: true | ||
|
||
var_dump( $globalPermission->getChurchwiki()->getEditMasterdata()); | ||
// Output: true | ||
|
||
var_dump( $globalPermission->getChurchcheckin()?->getEditMasterdata()); | ||
// Output: false | ||
|
||
|
||
``` |
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,13 @@ | ||
# Permission API | ||
|
||
## Internal Group Permission | ||
|
||
{{ \Tests\Unit\Docs\PermissionRequestTest.testGroupPermission }} | ||
|
||
## Internal Person Permission | ||
|
||
{{ \Tests\Unit\Docs\PermissionRequestTest.testPersonPermission }} | ||
|
||
## Global Permission (for logged in user) | ||
|
||
{{ \Tests\Unit\Docs\PermissionRequestTest.testGlobalPermission }} |
Oops, something went wrong.