Abstract_Visibility implements Visibility_Interface

This is an abstract class for visibility.

Tags
author

Barn2 Plugins support@barn2.com

license

GPL-3.0

copyright

Barn2 Media Ltd

Interfaces, Classes and Traits

Visibility_Interface

Table of Contents

$data_object  : object
The object to retrieve the visibility
$document_owner  : bool
The document owner can access the document.
$object_id  : int
The object id.
$object_type  : string
The type of object. (document, category, global_setting)
$passwords  : array<string|int, mixed>
Array of passwords that can be used to access the document.
$roles  : array<string|int, mixed>
Array of roles that can access the document.
$users  : array<string|int, mixed>
Array of users that can access the document.
$visibility  : string
The visibility level.
__construct()  : mixed
Constructor.
get_data_object()  : object
Retrieve the object.
get_document_owner()  : array<string|int, mixed>|false
Get the document owner for this category.
get_object_id()  : int
Retrieve the object id.
get_object_type()  : string
Retrieve the object type.
get_passwords()  : array<string|int, mixed>
Retrieve the list of passwords for this term.
get_protection_data()  : array<string|int, mixed>
Retrieve all the protection data for this term.
get_protection_types()  : mixed
Retrieve all the active protection types for this document.
get_roles()  : array<string|int, mixed>
Retrieve the list of roles for this term.
get_users()  : array<string|int, mixed>
Retrieve the list of users for this term.
get_visibility()  : string
Retrieve the visibility level for this term.
has_document_owner_protection()  : bool
Does this object have document owner protection?
has_password_protection()  : bool
Does this object have password protection?
has_protection()  : bool
Does this object have any form of protection?
has_role_protection()  : bool
Does this object have role protection?
has_user_protection()  : bool
Does this object have user protection?
is_inherited()  : bool
Is this visibility level inherited?
is_public()  : bool
Is this a public document?
is_unlocked()  : bool
Is this object unlocked by password, role, or user?
is_unlocked_by_password()  : bool
Is this object unlocked by password?
is_unlocked_by_role()  : bool
Is this object unlocked by role?
is_unlocked_by_user()  : bool
Is this category unlocked by the current user?

Properties

$data_object

The object to retrieve the visibility

protected object $data_object
Tags

$document_owner

The document owner can access the document.

protected bool $document_owner = false
Tags

$object_type

The type of object. (document, category, global_setting)

protected string $object_type
Tags

$passwords

Array of passwords that can be used to access the document.

protected array<string|int, mixed> $passwords = []
Tags

$roles

Array of roles that can access the document.

protected array<string|int, mixed> $roles = []
Tags

$users

Array of users that can access the document.

protected array<string|int, mixed> $users = []
Tags

Methods

__construct()

Constructor.

public __construct(object $data_object) : mixed
Parameters
$data_object : object

The object to retrieve the visibility for

Tags
Return values
mixed

get_data_object()

Retrieve the object.

public get_data_object() : object
Tags
Return values
object

get_document_owner()

Get the document owner for this category.

public get_document_owner() : array<string|int, mixed>|false
Tags
Return values
array<string|int, mixed>|false

The document owner, or false if none set

get_object_id()

Retrieve the object id.

public get_object_id() : int
Tags
Return values
int

get_object_type()

Retrieve the object type.

public get_object_type() : string
Tags
Return values
string

get_passwords()

Retrieve the list of passwords for this term.

public get_passwords() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed>

get_protection_data()

Retrieve all the protection data for this term.

public get_protection_data() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed>

get_protection_types()

Retrieve all the active protection types for this document.

public get_protection_types() : mixed
Tags
Return values
mixed

get_roles()

Retrieve the list of roles for this term.

public get_roles() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed>

get_users()

Retrieve the list of users for this term.

public get_users() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed>

get_visibility()

Retrieve the visibility level for this term.

public get_visibility() : string
Tags
Return values
string

has_document_owner_protection()

Does this object have document owner protection?

public has_document_owner_protection() : bool
Tags
Return values
bool

true if document owner protected

has_password_protection()

Does this object have password protection?

public has_password_protection() : bool
Tags
Return values
bool

true if password protected

has_protection()

Does this object have any form of protection?

public has_protection() : bool
Tags
Return values
bool

has_role_protection()

Does this object have role protection?

public has_role_protection() : bool
Tags
Return values
bool

true if role protected

has_user_protection()

Does this object have user protection?

public has_user_protection() : bool
Tags
Return values
bool

true if user protected

is_inherited()

Is this visibility level inherited?

public is_inherited() : bool
Tags
Return values
bool

is_public()

Is this a public document?

public is_public() : bool
Tags
Return values
bool

true if the document is public, false if not

is_unlocked()

Is this object unlocked by password, role, or user?

public is_unlocked() : bool
Tags
Return values
bool

true if unlocked.

is_unlocked_by_password()

Is this object unlocked by password?

public is_unlocked_by_password() : bool
Tags
Return values
bool

true if unlocked, false otherwise

is_unlocked_by_role()

Is this object unlocked by role?

public is_unlocked_by_role() : bool
Tags
Return values
bool

true if role protected and the current user has one of the required roles.

is_unlocked_by_user()

Is this category unlocked by the current user?

public is_unlocked_by_user() : bool
Tags
Return values
bool

true if user protected and the current user is allowed access.

Search results