\FileSecured
Extends {@link File} "transforming" it into an (optionally) secure object with related canXX() methods.
- Author: Deviate Ltd 2014-2016 http://www.deviate.net.nz
Synopsis
class FileSecured
extends DataExtension
implements
PermissionProvider
{
- // members
- private static array $db = ;
- private static array $many_many = ;
- private static array $cache_permissions = ;
- // methods
- private string showButtonsSecurity()
- private string showButtonsEmbargoexpiry()
- public void updateCMSFields()
- public boolean canViewFront()
- public boolean canViewFrontByTime()
- public boolean canViewFrontByUser()
- public boolean isEmbargoed()
- public boolean isExpired()
- public static Folder find_or_make_secured()
- public static Folder getSecuredRoot()
- public void onBeforeWrite()
- public void onAfterWrite()
- public SS_List ChildFoldersExcludeSecured()
- public SS_List ChildFoldersOnlySecured()
- public null getWhoCanViewHTML()
- public string getWhoCanViewNice()
- public null getWhoCanEditHTML()
- public string getWhoCanEditNice()
- public string getEmbargoHTML()
- public string getExpireHTML()
- public array providePermissions()
- public boolean canView()
- public boolean canEdit()
- public boolean canCreate()
- public boolean canDelete()
- public static array can_delete_multiple()
- public static array can_edit_multiple()
- public static array batch_permission_check()
- private boolean isFile()
Hierarchy
Extends
- DataExtension
Implements
- PermissionProvider
Tasks
Line | Task |
---|---|
12+ | How many of the "cloned" methods/props from {@link File} are actually needed? |
12+ | Refactor canXX() methods to use bitwise logic to make checks far less fallible |
985+ | Add test(s) |
Members
private
- $cache_permissions
—
array
Cache for canView/Edit/Create/Delete permissions. - $db — array
- $many_many — array
Methods
private
public
- ChildFoldersExcludeSecured()
- ChildFoldersOnlySecured()
- batch_permission_check() — This method is NOT a full replacement for the individual can*() methods, e.g. {@link canEdit()}.
- canCreate() — This function should return true if the current user can create new secured file.
- canDelete() — This function should return true if the current user can delete this secured file.
- canEdit() — This function should return true if the current user can edit this secured file.
- canView() — This function should return true if the current user can view this file.
- canViewFront() — General catch-all for {@link {$this->canViewFrontByTime()} and {@link {$this->canViewFrontByUser()}.
- canViewFrontByTime() — Returns if this is Document is embargoed or expired.
- canViewFrontByUser()
- can_delete_multiple() — Get the 'can edit' information for a number of advanced files.
- can_edit_multiple() — Get the 'can edit' information for a number of files.
- find_or_make_secured() — Find the given folder or create it both as {@link Folder} database record and on the filesystem. If necessary, creates parent folders as well. If it's unable to find or make the folder, it will return null (as /assets is unable to be represented by a Folder {@link DataObject}).
- getEmbargoHTML()
- getExpireHTML()
- getSecuredRoot()
- getWhoCanEditHTML()
- getWhoCanEditNice()
- getWhoCanViewHTML()
- getWhoCanViewNice()
- isEmbargoed() — Is this Document embargoed?
- isExpired() — Is this an expired Document?
- onAfterWrite()
- onBeforeWrite()
- providePermissions()
- updateCMSFields()