| @@ -4,8 +4,10 @@ | ||
| 4 | 4 | |
| 5 | 5 | class AuthorizationService { |
| 6 | 6 | |
| 7 | 7 | /** |
| 8 | + * Whether the current user has specified capabilities or not. | |
| 9 | + * | |
| 8 | 10 | * @param string|array $capabilities |
| 9 | 11 | * |
| 10 | 12 | * @return bool |
| 11 | 13 | */ |
| @@ -21,6 +23,15 @@ | ||
| 21 | 23 | } |
| 22 | 24 | } |
| 23 | 25 | |
| 24 | 26 | return false; |
| 27 | + } | |
| 28 | + | |
| 29 | + /** | |
| 30 | + * Whether current user is allowed to publish document or not | |
| 31 | + * | |
| 32 | + * @return bool | |
| 33 | + */ | |
| 34 | + public function currentUserCanPublishDocument(){ | |
| 35 | + return $this->currentUserCan( [ 'manage_options', 'publish_depicter' ] ); | |
| 25 | 36 | } |
| 26 | 37 | } |