# depicter/1.3.3/app/src/Services/AuthorizationService.php

Depicter — Popup &amp; Slider Builder, version 1.3.3. 38 lines.

- Page: https://pluginprobe.com/plugins/depicter/1.3.3/code/app/src/Services/AuthorizationService.php
- Raw: https://pluginprobe.com/plugins/depicter/1.3.3/raw/app/src/Services/AuthorizationService.php
- Modified: 2022-09-24T14:46:54+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/depicter/1.3.3/code/app/src/Services/AuthorizationService.php#L10-L20`.

```php
<?php

namespace Depicter\Services;

class AuthorizationService {

	/**
	 * Whether the current user has specified capabilities or not.
	 *
	 * @param string|array $capabilities
	 *
	 * @return bool
	 */
	public function currentUserCan( $capabilities ){
		if( empty( $capabilities ) ){
			return false;
		}

		$capabilities = (array) $capabilities;
		foreach( $capabilities as $capability ){
			if( current_user_can( $capability ) ){
				return true;
			}
		}

		return false;
	}

	/**
	 * Whether current user is allowed to publish document or not
	 *
	 * @return bool
	 */
	public function currentUserCanPublishDocument(){
		return $this->currentUserCan( [ 'manage_options', 'publish_depicter' ] );
	}
}

```
