30 lines
608 B
PHP
30 lines
608 B
PHP
<?php
|
|
|
|
namespace App;
|
|
|
|
enum FolderVisibility: string
|
|
{
|
|
case Private = 'private';
|
|
case Workspace = 'workspace';
|
|
|
|
/**
|
|
* Get the human-friendly label for the visibility.
|
|
*/
|
|
public function label(): string
|
|
{
|
|
return match ($this) {
|
|
self::Private => 'Private',
|
|
self::Workspace => 'Shared with workspace',
|
|
};
|
|
}
|
|
|
|
/**
|
|
* Determine whether a folder at this visibility is opened up to every
|
|
* member of its workspace.
|
|
*/
|
|
public function isSharedWithWorkspace(): bool
|
|
{
|
|
return $this === self::Workspace;
|
|
}
|
|
}
|