@@ -0,0 +1,29 @@
|
||||
<?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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user