This repository has been archived on 2024-09-05. You can view files and clone it, but cannot push or open issues or pull requests.
shimmie2/core/permissions.php

143 lines
5.4 KiB
PHP
Raw Normal View History

2021-12-14 18:32:47 +00:00
<?php
declare(strict_types=1);
2019-07-09 14:10:21 +00:00
namespace Shimmie2;
2023-02-15 22:26:34 +00:00
use GQLA\Enum;
// action_object_attribute
// action = create / view / edit / delete
// object = image / user / tag / setting
2023-02-15 22:26:34 +00:00
#[Enum(name: "Permission")]
2019-07-09 14:10:21 +00:00
abstract class Permissions
{
2023-06-24 20:24:25 +00:00
/** modify web-level settings, eg the config table */
public const CHANGE_SETTING = "change_setting";
/** modify sys-level settings, eg shimmie.conf.php */
public const OVERRIDE_CONFIG = "override_config";
/** modify own user-level settings */
public const CHANGE_USER_SETTING = "change_user_setting";
public const CHANGE_OTHER_USER_SETTING = "change_other_user_setting";
/** search for more than 3 tags at once (only applies if Speed Hax is active) */
2023-06-24 20:24:25 +00:00
public const BIG_SEARCH = "big_search";
/** enable or disable extensions */
2019-07-09 14:10:21 +00:00
public const MANAGE_EXTENSION_LIST = "manage_extension_list";
public const MANAGE_ALIAS_LIST = "manage_alias_list";
2020-03-02 15:24:40 +00:00
public const MANAGE_AUTO_TAG = "manage_auto_tag";
2019-07-09 14:10:21 +00:00
public const MASS_TAG_EDIT = "mass_tag_edit";
2023-06-24 20:24:25 +00:00
/** View which IP address posted a comment / image / etc */
public const VIEW_IP = "view_ip";
2019-07-09 14:10:21 +00:00
public const BAN_IP = "ban_ip";
public const CREATE_USER = "create_user";
2020-05-19 18:33:51 +00:00
public const CREATE_OTHER_USER = "create_other_user";
2019-07-09 14:10:21 +00:00
public const EDIT_USER_NAME = "edit_user_name";
public const EDIT_USER_PASSWORD = "edit_user_password";
2023-06-24 20:24:25 +00:00
/** Edit metadata about a user (eg email address) */
public const EDIT_USER_INFO = "edit_user_info";
2019-07-09 14:10:21 +00:00
public const EDIT_USER_CLASS = "edit_user_class";
public const DELETE_USER = "delete_user";
public const CREATE_COMMENT = "create_comment";
public const DELETE_COMMENT = "delete_comment";
2023-06-24 20:24:25 +00:00
/** Allow a user to make comments even if the spam-detector disapproves */
public const BYPASS_COMMENT_CHECKS = "bypass_comment_checks";
2019-07-09 14:10:21 +00:00
public const REPLACE_IMAGE = "replace_image";
public const CREATE_IMAGE = "create_image";
public const EDIT_IMAGE_TAG = "edit_image_tag";
public const EDIT_IMAGE_SOURCE = "edit_image_source";
public const EDIT_IMAGE_OWNER = "edit_image_owner";
public const EDIT_IMAGE_LOCK = "edit_image_lock";
public const EDIT_IMAGE_TITLE = "edit_image_title";
public const EDIT_IMAGE_RELATIONSHIPS = "edit_image_relationships";
public const EDIT_IMAGE_ARTIST = "edit_image_artist";
2019-07-09 14:10:21 +00:00
public const BULK_EDIT_IMAGE_TAG = "bulk_edit_image_tag";
public const BULK_EDIT_IMAGE_SOURCE = "bulk_edit_image_source";
public const DELETE_IMAGE = "delete_image";
public const BAN_IMAGE = "ban_image";
public const VIEW_EVENTLOG = "view_eventlog";
public const IGNORE_DOWNTIME = "ignore_downtime";
public const VIEW_REGISTRATIONS = "view_registrations";
2019-07-09 14:10:21 +00:00
public const CREATE_IMAGE_REPORT = "create_image_report";
2023-06-24 20:24:25 +00:00
/** deal with reported images */
public const VIEW_IMAGE_REPORT = "view_image_report";
2019-07-09 14:10:21 +00:00
2019-09-29 18:00:51 +00:00
public const WIKI_ADMIN = "wiki_admin";
2019-07-09 14:10:21 +00:00
public const EDIT_WIKI_PAGE = "edit_wiki_page";
public const DELETE_WIKI_PAGE = "delete_wiki_page";
public const MANAGE_BLOCKS = "manage_blocks";
public const MANAGE_ADMINTOOLS = "manage_admintools";
public const SEND_PM = "send_pm";
public const READ_PM = "read_pm";
2019-07-09 14:10:21 +00:00
public const VIEW_OTHER_PMS = "view_other_pms";
2023-02-24 05:32:23 +00:00
2019-07-09 14:10:21 +00:00
public const EDIT_FEATURE = "edit_feature";
2023-02-24 05:32:23 +00:00
public const CREATE_VOTE = "create_vote";
2019-07-09 14:10:21 +00:00
public const BULK_EDIT_VOTE = "bulk_edit_vote";
public const EDIT_OTHER_VOTE = "edit_other_vote";
2023-02-24 05:32:23 +00:00
public const VIEW_SYSINFO = "view_sysinfo";
2019-07-09 14:10:21 +00:00
public const HELLBANNED = "hellbanned";
public const VIEW_HELLBANNED = "view_hellbanned";
2023-06-24 20:24:25 +00:00
/** only admins can modify protected users (stops a moderator from changing an admin's password) */
public const PROTECTED = "protected";
2019-07-09 14:10:21 +00:00
public const EDIT_IMAGE_RATING = "edit_image_rating";
public const BULK_EDIT_IMAGE_RATING = "bulk_edit_image_rating";
public const VIEW_TRASH = "view_trash";
2019-07-13 22:39:27 +00:00
public const PERFORM_BULK_ACTIONS = "perform_bulk_actions";
2019-09-29 18:00:51 +00:00
public const BULK_ADD = "bulk_add";
public const EDIT_FILES = "edit_files";
public const EDIT_TAG_CATEGORIES = "edit_tag_categories";
public const RESCAN_MEDIA = "rescan_media";
public const SEE_IMAGE_VIEW_COUNTS = "see_image_view_counts";
public const EDIT_FAVOURITES = "edit_favourites";
2019-09-29 18:00:51 +00:00
public const ARTISTS_ADMIN = "artists_admin";
public const BLOTTER_ADMIN = "blotter_admin";
public const TIPS_ADMIN = "tips_admin";
2019-10-17 19:22:33 +00:00
public const CRON_ADMIN = "cron_admin";
2019-10-14 18:43:49 +00:00
public const APPROVE_IMAGE = "approve_image";
public const APPROVE_COMMENT = "approve_comment";
2023-06-14 07:48:38 +00:00
public const BYPASS_IMAGE_APPROVAL = "bypass_image_approval";
2020-06-02 23:08:24 +00:00
2024-02-10 23:32:50 +00:00
public const FORUM_ADMIN = "forum_admin";
public const FORUM_CREATE = "forum_create";
2024-02-10 23:32:50 +00:00
public const NOTES_ADMIN = "notes_admin";
public const NOTES_CREATE = "notes_create";
public const NOTES_EDIT = "notes_edit";
public const NOTES_REQUEST = "notes_request";
2024-02-10 23:32:50 +00:00
public const POOLS_ADMIN = "pools_admin";
public const POOLS_CREATE = "pools_create";
public const POOLS_UPDATE = "pools_update";
2020-06-02 23:08:24 +00:00
public const SET_PRIVATE_IMAGE = "set_private_image";
public const SET_OTHERS_PRIVATE_IMAGES = "set_others_private_images";
public const CRON_RUN = "cron_run";
2020-06-02 23:05:09 +00:00
public const BULK_IMPORT = "bulk_import";
public const BULK_EXPORT = "bulk_export";
2020-06-22 00:17:58 +00:00
public const BULK_DOWNLOAD = "bulk_download";
2023-03-30 19:37:06 +00:00
public const BULK_PARENT_CHILD = "bulk_parent_child";
2019-09-29 13:30:55 +00:00
}