github.com/adacta-ru/mattermost-server/v6@v6.0.0/model/permission.go (about)

     1  // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
     2  // See LICENSE.txt for license information.
     3  
     4  package model
     5  
     6  const (
     7  	PermissionScopeSystem  = "system_scope"
     8  	PermissionScopeTeam    = "team_scope"
     9  	PermissionScopeChannel = "channel_scope"
    10  )
    11  
    12  type Permission struct {
    13  	Id          string `json:"id"`
    14  	Name        string `json:"name"`
    15  	Description string `json:"description"`
    16  	Scope       string `json:"scope"`
    17  }
    18  
    19  var PERMISSION_INVITE_USER *Permission
    20  var PERMISSION_ADD_USER_TO_TEAM *Permission
    21  var PERMISSION_USE_SLASH_COMMANDS *Permission
    22  var PERMISSION_MANAGE_SLASH_COMMANDS *Permission
    23  var PERMISSION_MANAGE_OTHERS_SLASH_COMMANDS *Permission
    24  var PERMISSION_CREATE_PUBLIC_CHANNEL *Permission
    25  var PERMISSION_CREATE_PRIVATE_CHANNEL *Permission
    26  var PERMISSION_MANAGE_PUBLIC_CHANNEL_MEMBERS *Permission
    27  var PERMISSION_MANAGE_PRIVATE_CHANNEL_MEMBERS *Permission
    28  var PERMISSION_CONVERT_PUBLIC_CHANNEL_TO_PRIVATE *Permission
    29  var PERMISSION_CONVERT_PRIVATE_CHANNEL_TO_PUBLIC *Permission
    30  var PERMISSION_ASSIGN_SYSTEM_ADMIN_ROLE *Permission
    31  var PERMISSION_MANAGE_ROLES *Permission
    32  var PERMISSION_MANAGE_TEAM_ROLES *Permission
    33  var PERMISSION_MANAGE_CHANNEL_ROLES *Permission
    34  var PERMISSION_CREATE_DIRECT_CHANNEL *Permission
    35  var PERMISSION_CREATE_GROUP_CHANNEL *Permission
    36  var PERMISSION_MANAGE_PUBLIC_CHANNEL_PROPERTIES *Permission
    37  var PERMISSION_MANAGE_PRIVATE_CHANNEL_PROPERTIES *Permission
    38  var PERMISSION_LIST_PUBLIC_TEAMS *Permission
    39  var PERMISSION_JOIN_PUBLIC_TEAMS *Permission
    40  var PERMISSION_LIST_PRIVATE_TEAMS *Permission
    41  var PERMISSION_JOIN_PRIVATE_TEAMS *Permission
    42  var PERMISSION_LIST_TEAM_CHANNELS *Permission
    43  var PERMISSION_JOIN_PUBLIC_CHANNELS *Permission
    44  var PERMISSION_DELETE_PUBLIC_CHANNEL *Permission
    45  var PERMISSION_DELETE_PRIVATE_CHANNEL *Permission
    46  var PERMISSION_EDIT_OTHER_USERS *Permission
    47  var PERMISSION_READ_CHANNEL *Permission
    48  var PERMISSION_READ_PUBLIC_CHANNEL_GROUPS *Permission
    49  var PERMISSION_READ_PRIVATE_CHANNEL_GROUPS *Permission
    50  var PERMISSION_READ_PUBLIC_CHANNEL *Permission
    51  var PERMISSION_ADD_REACTION *Permission
    52  var PERMISSION_REMOVE_REACTION *Permission
    53  var PERMISSION_REMOVE_OTHERS_REACTIONS *Permission
    54  var PERMISSION_PERMANENT_DELETE_USER *Permission
    55  var PERMISSION_UPLOAD_FILE *Permission
    56  var PERMISSION_GET_PUBLIC_LINK *Permission
    57  var PERMISSION_MANAGE_WEBHOOKS *Permission
    58  var PERMISSION_MANAGE_OTHERS_WEBHOOKS *Permission
    59  var PERMISSION_MANAGE_INCOMING_WEBHOOKS *Permission
    60  var PERMISSION_MANAGE_OUTGOING_WEBHOOKS *Permission
    61  var PERMISSION_MANAGE_OTHERS_INCOMING_WEBHOOKS *Permission
    62  var PERMISSION_MANAGE_OTHERS_OUTGOING_WEBHOOKS *Permission
    63  var PERMISSION_MANAGE_OAUTH *Permission
    64  var PERMISSION_MANAGE_SYSTEM_WIDE_OAUTH *Permission
    65  var PERMISSION_MANAGE_EMOJIS *Permission
    66  var PERMISSION_MANAGE_OTHERS_EMOJIS *Permission
    67  var PERMISSION_CREATE_EMOJIS *Permission
    68  var PERMISSION_DELETE_EMOJIS *Permission
    69  var PERMISSION_DELETE_OTHERS_EMOJIS *Permission
    70  var PERMISSION_CREATE_POST *Permission
    71  var PERMISSION_CREATE_POST_PUBLIC *Permission
    72  var PERMISSION_CREATE_POST_EPHEMERAL *Permission
    73  var PERMISSION_EDIT_POST *Permission
    74  var PERMISSION_EDIT_OTHERS_POSTS *Permission
    75  var PERMISSION_DELETE_POST *Permission
    76  var PERMISSION_DELETE_OTHERS_POSTS *Permission
    77  var PERMISSION_REMOVE_USER_FROM_TEAM *Permission
    78  var PERMISSION_CREATE_TEAM *Permission
    79  var PERMISSION_MANAGE_TEAM *Permission
    80  var PERMISSION_IMPORT_TEAM *Permission
    81  var PERMISSION_VIEW_TEAM *Permission
    82  var PERMISSION_LIST_USERS_WITHOUT_TEAM *Permission
    83  var PERMISSION_READ_JOBS *Permission
    84  var PERMISSION_MANAGE_JOBS *Permission
    85  var PERMISSION_CREATE_USER_ACCESS_TOKEN *Permission
    86  var PERMISSION_READ_USER_ACCESS_TOKEN *Permission
    87  var PERMISSION_REVOKE_USER_ACCESS_TOKEN *Permission
    88  var PERMISSION_CREATE_BOT *Permission
    89  var PERMISSION_ASSIGN_BOT *Permission
    90  var PERMISSION_READ_BOTS *Permission
    91  var PERMISSION_READ_OTHERS_BOTS *Permission
    92  var PERMISSION_MANAGE_BOTS *Permission
    93  var PERMISSION_MANAGE_OTHERS_BOTS *Permission
    94  var PERMISSION_VIEW_MEMBERS *Permission
    95  var PERMISSION_INVITE_GUEST *Permission
    96  var PERMISSION_PROMOTE_GUEST *Permission
    97  var PERMISSION_DEMOTE_TO_GUEST *Permission
    98  var PERMISSION_USE_CHANNEL_MENTIONS *Permission
    99  var PERMISSION_USE_GROUP_MENTIONS *Permission
   100  var PERMISSION_READ_OTHER_USERS_TEAMS *Permission
   101  var PERMISSION_EDIT_BRAND *Permission
   102  var PERMISSION_MANAGE_SHARED_CHANNELS *Permission
   103  var PERMISSION_MANAGE_REMOTE_CLUSTERS *Permission
   104  
   105  var PERMISSION_SYSCONSOLE_READ_ABOUT *Permission
   106  var PERMISSION_SYSCONSOLE_WRITE_ABOUT *Permission
   107  
   108  var PERMISSION_SYSCONSOLE_READ_BILLING *Permission
   109  var PERMISSION_SYSCONSOLE_WRITE_BILLING *Permission
   110  
   111  var PERMISSION_SYSCONSOLE_READ_REPORTING *Permission
   112  var PERMISSION_SYSCONSOLE_WRITE_REPORTING *Permission
   113  
   114  var PERMISSION_SYSCONSOLE_READ_USERMANAGEMENT_USERS *Permission
   115  var PERMISSION_SYSCONSOLE_WRITE_USERMANAGEMENT_USERS *Permission
   116  
   117  var PERMISSION_SYSCONSOLE_READ_USERMANAGEMENT_GROUPS *Permission
   118  var PERMISSION_SYSCONSOLE_WRITE_USERMANAGEMENT_GROUPS *Permission
   119  
   120  var PERMISSION_SYSCONSOLE_READ_USERMANAGEMENT_TEAMS *Permission
   121  var PERMISSION_SYSCONSOLE_WRITE_USERMANAGEMENT_TEAMS *Permission
   122  
   123  var PERMISSION_SYSCONSOLE_READ_USERMANAGEMENT_CHANNELS *Permission
   124  var PERMISSION_SYSCONSOLE_WRITE_USERMANAGEMENT_CHANNELS *Permission
   125  
   126  var PERMISSION_SYSCONSOLE_READ_USERMANAGEMENT_PERMISSIONS *Permission
   127  var PERMISSION_SYSCONSOLE_WRITE_USERMANAGEMENT_PERMISSIONS *Permission
   128  
   129  var PERMISSION_SYSCONSOLE_READ_USERMANAGEMENT_SYSTEM_ROLES *Permission
   130  var PERMISSION_SYSCONSOLE_WRITE_USERMANAGEMENT_SYSTEM_ROLES *Permission
   131  
   132  var PERMISSION_SYSCONSOLE_READ_ENVIRONMENT *Permission
   133  var PERMISSION_SYSCONSOLE_WRITE_ENVIRONMENT *Permission
   134  
   135  var PERMISSION_SYSCONSOLE_READ_SITE *Permission
   136  var PERMISSION_SYSCONSOLE_WRITE_SITE *Permission
   137  
   138  var PERMISSION_SYSCONSOLE_READ_AUTHENTICATION *Permission
   139  var PERMISSION_SYSCONSOLE_WRITE_AUTHENTICATION *Permission
   140  
   141  var PERMISSION_SYSCONSOLE_READ_PLUGINS *Permission
   142  var PERMISSION_SYSCONSOLE_WRITE_PLUGINS *Permission
   143  
   144  var PERMISSION_SYSCONSOLE_READ_INTEGRATIONS *Permission
   145  var PERMISSION_SYSCONSOLE_WRITE_INTEGRATIONS *Permission
   146  
   147  var PERMISSION_SYSCONSOLE_READ_COMPLIANCE *Permission
   148  var PERMISSION_SYSCONSOLE_WRITE_COMPLIANCE *Permission
   149  
   150  var PERMISSION_SYSCONSOLE_READ_EXPERIMENTAL *Permission
   151  var PERMISSION_SYSCONSOLE_WRITE_EXPERIMENTAL *Permission
   152  
   153  // General permission that encompasses all system admin functions
   154  // in the future this could be broken up to allow access to some
   155  // admin functions but not others
   156  var PERMISSION_MANAGE_SYSTEM *Permission
   157  
   158  var AllPermissions []*Permission
   159  var DeprecatedPermissions []*Permission
   160  
   161  var ChannelModeratedPermissions []string
   162  var ChannelModeratedPermissionsMap map[string]string
   163  
   164  var SysconsoleReadPermissions []*Permission
   165  var SysconsoleWritePermissions []*Permission
   166  
   167  func initializePermissions() {
   168  	PERMISSION_INVITE_USER = &Permission{
   169  		"invite_user",
   170  		"authentication.permissions.team_invite_user.name",
   171  		"authentication.permissions.team_invite_user.description",
   172  		PermissionScopeTeam,
   173  	}
   174  	PERMISSION_ADD_USER_TO_TEAM = &Permission{
   175  		"add_user_to_team",
   176  		"authentication.permissions.add_user_to_team.name",
   177  		"authentication.permissions.add_user_to_team.description",
   178  		PermissionScopeTeam,
   179  	}
   180  	PERMISSION_USE_SLASH_COMMANDS = &Permission{
   181  		"use_slash_commands",
   182  		"authentication.permissions.team_use_slash_commands.name",
   183  		"authentication.permissions.team_use_slash_commands.description",
   184  		PermissionScopeChannel,
   185  	}
   186  	PERMISSION_MANAGE_SLASH_COMMANDS = &Permission{
   187  		"manage_slash_commands",
   188  		"authentication.permissions.manage_slash_commands.name",
   189  		"authentication.permissions.manage_slash_commands.description",
   190  		PermissionScopeTeam,
   191  	}
   192  	PERMISSION_MANAGE_OTHERS_SLASH_COMMANDS = &Permission{
   193  		"manage_others_slash_commands",
   194  		"authentication.permissions.manage_others_slash_commands.name",
   195  		"authentication.permissions.manage_others_slash_commands.description",
   196  		PermissionScopeTeam,
   197  	}
   198  	PERMISSION_CREATE_PUBLIC_CHANNEL = &Permission{
   199  		"create_public_channel",
   200  		"authentication.permissions.create_public_channel.name",
   201  		"authentication.permissions.create_public_channel.description",
   202  		PermissionScopeTeam,
   203  	}
   204  	PERMISSION_CREATE_PRIVATE_CHANNEL = &Permission{
   205  		"create_private_channel",
   206  		"authentication.permissions.create_private_channel.name",
   207  		"authentication.permissions.create_private_channel.description",
   208  		PermissionScopeTeam,
   209  	}
   210  	PERMISSION_MANAGE_PUBLIC_CHANNEL_MEMBERS = &Permission{
   211  		"manage_public_channel_members",
   212  		"authentication.permissions.manage_public_channel_members.name",
   213  		"authentication.permissions.manage_public_channel_members.description",
   214  		PermissionScopeChannel,
   215  	}
   216  	PERMISSION_MANAGE_PRIVATE_CHANNEL_MEMBERS = &Permission{
   217  		"manage_private_channel_members",
   218  		"authentication.permissions.manage_private_channel_members.name",
   219  		"authentication.permissions.manage_private_channel_members.description",
   220  		PermissionScopeChannel,
   221  	}
   222  	PERMISSION_CONVERT_PUBLIC_CHANNEL_TO_PRIVATE = &Permission{
   223  		"convert_public_channel_to_private",
   224  		"authentication.permissions.convert_public_channel_to_private.name",
   225  		"authentication.permissions.convert_public_channel_to_private.description",
   226  		PermissionScopeChannel,
   227  	}
   228  	PERMISSION_CONVERT_PRIVATE_CHANNEL_TO_PUBLIC = &Permission{
   229  		"convert_private_channel_to_public",
   230  		"authentication.permissions.convert_private_channel_to_public.name",
   231  		"authentication.permissions.convert_private_channel_to_public.description",
   232  		PermissionScopeChannel,
   233  	}
   234  	PERMISSION_ASSIGN_SYSTEM_ADMIN_ROLE = &Permission{
   235  		"assign_system_admin_role",
   236  		"authentication.permissions.assign_system_admin_role.name",
   237  		"authentication.permissions.assign_system_admin_role.description",
   238  		PermissionScopeSystem,
   239  	}
   240  	PERMISSION_MANAGE_ROLES = &Permission{
   241  		"manage_roles",
   242  		"authentication.permissions.manage_roles.name",
   243  		"authentication.permissions.manage_roles.description",
   244  		PermissionScopeSystem,
   245  	}
   246  	PERMISSION_MANAGE_TEAM_ROLES = &Permission{
   247  		"manage_team_roles",
   248  		"authentication.permissions.manage_team_roles.name",
   249  		"authentication.permissions.manage_team_roles.description",
   250  		PermissionScopeTeam,
   251  	}
   252  	PERMISSION_MANAGE_CHANNEL_ROLES = &Permission{
   253  		"manage_channel_roles",
   254  		"authentication.permissions.manage_channel_roles.name",
   255  		"authentication.permissions.manage_channel_roles.description",
   256  		PermissionScopeChannel,
   257  	}
   258  	PERMISSION_MANAGE_SYSTEM = &Permission{
   259  		"manage_system",
   260  		"authentication.permissions.manage_system.name",
   261  		"authentication.permissions.manage_system.description",
   262  		PermissionScopeSystem,
   263  	}
   264  	PERMISSION_CREATE_DIRECT_CHANNEL = &Permission{
   265  		"create_direct_channel",
   266  		"authentication.permissions.create_direct_channel.name",
   267  		"authentication.permissions.create_direct_channel.description",
   268  		PermissionScopeSystem,
   269  	}
   270  	PERMISSION_CREATE_GROUP_CHANNEL = &Permission{
   271  		"create_group_channel",
   272  		"authentication.permissions.create_group_channel.name",
   273  		"authentication.permissions.create_group_channel.description",
   274  		PermissionScopeSystem,
   275  	}
   276  	PERMISSION_MANAGE_PUBLIC_CHANNEL_PROPERTIES = &Permission{
   277  		"manage_public_channel_properties",
   278  		"authentication.permissions.manage_public_channel_properties.name",
   279  		"authentication.permissions.manage_public_channel_properties.description",
   280  		PermissionScopeChannel,
   281  	}
   282  	PERMISSION_MANAGE_PRIVATE_CHANNEL_PROPERTIES = &Permission{
   283  		"manage_private_channel_properties",
   284  		"authentication.permissions.manage_private_channel_properties.name",
   285  		"authentication.permissions.manage_private_channel_properties.description",
   286  		PermissionScopeChannel,
   287  	}
   288  	PERMISSION_LIST_PUBLIC_TEAMS = &Permission{
   289  		"list_public_teams",
   290  		"authentication.permissions.list_public_teams.name",
   291  		"authentication.permissions.list_public_teams.description",
   292  		PermissionScopeSystem,
   293  	}
   294  	PERMISSION_JOIN_PUBLIC_TEAMS = &Permission{
   295  		"join_public_teams",
   296  		"authentication.permissions.join_public_teams.name",
   297  		"authentication.permissions.join_public_teams.description",
   298  		PermissionScopeSystem,
   299  	}
   300  	PERMISSION_LIST_PRIVATE_TEAMS = &Permission{
   301  		"list_private_teams",
   302  		"authentication.permissions.list_private_teams.name",
   303  		"authentication.permissions.list_private_teams.description",
   304  		PermissionScopeSystem,
   305  	}
   306  	PERMISSION_JOIN_PRIVATE_TEAMS = &Permission{
   307  		"join_private_teams",
   308  		"authentication.permissions.join_private_teams.name",
   309  		"authentication.permissions.join_private_teams.description",
   310  		PermissionScopeSystem,
   311  	}
   312  	PERMISSION_LIST_TEAM_CHANNELS = &Permission{
   313  		"list_team_channels",
   314  		"authentication.permissions.list_team_channels.name",
   315  		"authentication.permissions.list_team_channels.description",
   316  		PermissionScopeTeam,
   317  	}
   318  	PERMISSION_JOIN_PUBLIC_CHANNELS = &Permission{
   319  		"join_public_channels",
   320  		"authentication.permissions.join_public_channels.name",
   321  		"authentication.permissions.join_public_channels.description",
   322  		PermissionScopeTeam,
   323  	}
   324  	PERMISSION_DELETE_PUBLIC_CHANNEL = &Permission{
   325  		"delete_public_channel",
   326  		"authentication.permissions.delete_public_channel.name",
   327  		"authentication.permissions.delete_public_channel.description",
   328  		PermissionScopeChannel,
   329  	}
   330  	PERMISSION_DELETE_PRIVATE_CHANNEL = &Permission{
   331  		"delete_private_channel",
   332  		"authentication.permissions.delete_private_channel.name",
   333  		"authentication.permissions.delete_private_channel.description",
   334  		PermissionScopeChannel,
   335  	}
   336  	PERMISSION_EDIT_OTHER_USERS = &Permission{
   337  		"edit_other_users",
   338  		"authentication.permissions.edit_other_users.name",
   339  		"authentication.permissions.edit_other_users.description",
   340  		PermissionScopeSystem,
   341  	}
   342  	PERMISSION_READ_CHANNEL = &Permission{
   343  		"read_channel",
   344  		"authentication.permissions.read_channel.name",
   345  		"authentication.permissions.read_channel.description",
   346  		PermissionScopeChannel,
   347  	}
   348  	PERMISSION_READ_PUBLIC_CHANNEL_GROUPS = &Permission{
   349  		"read_public_channel_groups",
   350  		"authentication.permissions.read_public_channel_groups.name",
   351  		"authentication.permissions.read_public_channel_groups.description",
   352  		PermissionScopeChannel,
   353  	}
   354  	PERMISSION_READ_PRIVATE_CHANNEL_GROUPS = &Permission{
   355  		"read_private_channel_groups",
   356  		"authentication.permissions.read_private_channel_groups.name",
   357  		"authentication.permissions.read_private_channel_groups.description",
   358  		PermissionScopeChannel,
   359  	}
   360  	PERMISSION_READ_PUBLIC_CHANNEL = &Permission{
   361  		"read_public_channel",
   362  		"authentication.permissions.read_public_channel.name",
   363  		"authentication.permissions.read_public_channel.description",
   364  		PermissionScopeTeam,
   365  	}
   366  	PERMISSION_ADD_REACTION = &Permission{
   367  		"add_reaction",
   368  		"authentication.permissions.add_reaction.name",
   369  		"authentication.permissions.add_reaction.description",
   370  		PermissionScopeChannel,
   371  	}
   372  	PERMISSION_REMOVE_REACTION = &Permission{
   373  		"remove_reaction",
   374  		"authentication.permissions.remove_reaction.name",
   375  		"authentication.permissions.remove_reaction.description",
   376  		PermissionScopeChannel,
   377  	}
   378  	PERMISSION_REMOVE_OTHERS_REACTIONS = &Permission{
   379  		"remove_others_reactions",
   380  		"authentication.permissions.remove_others_reactions.name",
   381  		"authentication.permissions.remove_others_reactions.description",
   382  		PermissionScopeChannel,
   383  	}
   384  	// DEPRECATED
   385  	PERMISSION_PERMANENT_DELETE_USER = &Permission{
   386  		"permanent_delete_user",
   387  		"authentication.permissions.permanent_delete_user.name",
   388  		"authentication.permissions.permanent_delete_user.description",
   389  		PermissionScopeSystem,
   390  	}
   391  	PERMISSION_UPLOAD_FILE = &Permission{
   392  		"upload_file",
   393  		"authentication.permissions.upload_file.name",
   394  		"authentication.permissions.upload_file.description",
   395  		PermissionScopeChannel,
   396  	}
   397  	PERMISSION_GET_PUBLIC_LINK = &Permission{
   398  		"get_public_link",
   399  		"authentication.permissions.get_public_link.name",
   400  		"authentication.permissions.get_public_link.description",
   401  		PermissionScopeSystem,
   402  	}
   403  	// DEPRECATED
   404  	PERMISSION_MANAGE_WEBHOOKS = &Permission{
   405  		"manage_webhooks",
   406  		"authentication.permissions.manage_webhooks.name",
   407  		"authentication.permissions.manage_webhooks.description",
   408  		PermissionScopeTeam,
   409  	}
   410  	// DEPRECATED
   411  	PERMISSION_MANAGE_OTHERS_WEBHOOKS = &Permission{
   412  		"manage_others_webhooks",
   413  		"authentication.permissions.manage_others_webhooks.name",
   414  		"authentication.permissions.manage_others_webhooks.description",
   415  		PermissionScopeTeam,
   416  	}
   417  	PERMISSION_MANAGE_INCOMING_WEBHOOKS = &Permission{
   418  		"manage_incoming_webhooks",
   419  		"authentication.permissions.manage_incoming_webhooks.name",
   420  		"authentication.permissions.manage_incoming_webhooks.description",
   421  		PermissionScopeTeam,
   422  	}
   423  	PERMISSION_MANAGE_OUTGOING_WEBHOOKS = &Permission{
   424  		"manage_outgoing_webhooks",
   425  		"authentication.permissions.manage_outgoing_webhooks.name",
   426  		"authentication.permissions.manage_outgoing_webhooks.description",
   427  		PermissionScopeTeam,
   428  	}
   429  	PERMISSION_MANAGE_OTHERS_INCOMING_WEBHOOKS = &Permission{
   430  		"manage_others_incoming_webhooks",
   431  		"authentication.permissions.manage_others_incoming_webhooks.name",
   432  		"authentication.permissions.manage_others_incoming_webhooks.description",
   433  		PermissionScopeTeam,
   434  	}
   435  	PERMISSION_MANAGE_OTHERS_OUTGOING_WEBHOOKS = &Permission{
   436  		"manage_others_outgoing_webhooks",
   437  		"authentication.permissions.manage_others_outgoing_webhooks.name",
   438  		"authentication.permissions.manage_others_outgoing_webhooks.description",
   439  		PermissionScopeTeam,
   440  	}
   441  	PERMISSION_MANAGE_OAUTH = &Permission{
   442  		"manage_oauth",
   443  		"authentication.permissions.manage_oauth.name",
   444  		"authentication.permissions.manage_oauth.description",
   445  		PermissionScopeSystem,
   446  	}
   447  	PERMISSION_MANAGE_SYSTEM_WIDE_OAUTH = &Permission{
   448  		"manage_system_wide_oauth",
   449  		"authentication.permissions.manage_system_wide_oauth.name",
   450  		"authentication.permissions.manage_system_wide_oauth.description",
   451  		PermissionScopeSystem,
   452  	}
   453  	// DEPRECATED
   454  	PERMISSION_MANAGE_EMOJIS = &Permission{
   455  		"manage_emojis",
   456  		"authentication.permissions.manage_emojis.name",
   457  		"authentication.permissions.manage_emojis.description",
   458  		PermissionScopeTeam,
   459  	}
   460  	// DEPRECATED
   461  	PERMISSION_MANAGE_OTHERS_EMOJIS = &Permission{
   462  		"manage_others_emojis",
   463  		"authentication.permissions.manage_others_emojis.name",
   464  		"authentication.permissions.manage_others_emojis.description",
   465  		PermissionScopeTeam,
   466  	}
   467  	PERMISSION_CREATE_EMOJIS = &Permission{
   468  		"create_emojis",
   469  		"authentication.permissions.create_emojis.name",
   470  		"authentication.permissions.create_emojis.description",
   471  		PermissionScopeTeam,
   472  	}
   473  	PERMISSION_DELETE_EMOJIS = &Permission{
   474  		"delete_emojis",
   475  		"authentication.permissions.delete_emojis.name",
   476  		"authentication.permissions.delete_emojis.description",
   477  		PermissionScopeTeam,
   478  	}
   479  	PERMISSION_DELETE_OTHERS_EMOJIS = &Permission{
   480  		"delete_others_emojis",
   481  		"authentication.permissions.delete_others_emojis.name",
   482  		"authentication.permissions.delete_others_emojis.description",
   483  		PermissionScopeTeam,
   484  	}
   485  	PERMISSION_CREATE_POST = &Permission{
   486  		"create_post",
   487  		"authentication.permissions.create_post.name",
   488  		"authentication.permissions.create_post.description",
   489  		PermissionScopeChannel,
   490  	}
   491  	PERMISSION_CREATE_POST_PUBLIC = &Permission{
   492  		"create_post_public",
   493  		"authentication.permissions.create_post_public.name",
   494  		"authentication.permissions.create_post_public.description",
   495  		PermissionScopeChannel,
   496  	}
   497  	PERMISSION_CREATE_POST_EPHEMERAL = &Permission{
   498  		"create_post_ephemeral",
   499  		"authentication.permissions.create_post_ephemeral.name",
   500  		"authentication.permissions.create_post_ephemeral.description",
   501  		PermissionScopeChannel,
   502  	}
   503  	PERMISSION_EDIT_POST = &Permission{
   504  		"edit_post",
   505  		"authentication.permissions.edit_post.name",
   506  		"authentication.permissions.edit_post.description",
   507  		PermissionScopeChannel,
   508  	}
   509  	PERMISSION_EDIT_OTHERS_POSTS = &Permission{
   510  		"edit_others_posts",
   511  		"authentication.permissions.edit_others_posts.name",
   512  		"authentication.permissions.edit_others_posts.description",
   513  		PermissionScopeChannel,
   514  	}
   515  	PERMISSION_DELETE_POST = &Permission{
   516  		"delete_post",
   517  		"authentication.permissions.delete_post.name",
   518  		"authentication.permissions.delete_post.description",
   519  		PermissionScopeChannel,
   520  	}
   521  	PERMISSION_DELETE_OTHERS_POSTS = &Permission{
   522  		"delete_others_posts",
   523  		"authentication.permissions.delete_others_posts.name",
   524  		"authentication.permissions.delete_others_posts.description",
   525  		PermissionScopeChannel,
   526  	}
   527  	PERMISSION_MANAGE_SHARED_CHANNELS = &Permission{
   528  		"manage_shared_channels",
   529  		"authentication.permissions.manage_shared_channels.name",
   530  		"authentication.permissions.manage_shared_channels.description",
   531  		PermissionScopeSystem,
   532  	}
   533  	PERMISSION_MANAGE_REMOTE_CLUSTERS = &Permission{
   534  		"manage_remote_clusters",
   535  		"authentication.permissions.manage_remote_clusters.name",
   536  		"authentication.permissions.manage_remote_clusters.description",
   537  		PermissionScopeSystem,
   538  	}
   539  	PERMISSION_REMOVE_USER_FROM_TEAM = &Permission{
   540  		"remove_user_from_team",
   541  		"authentication.permissions.remove_user_from_team.name",
   542  		"authentication.permissions.remove_user_from_team.description",
   543  		PermissionScopeTeam,
   544  	}
   545  	PERMISSION_CREATE_TEAM = &Permission{
   546  		"create_team",
   547  		"authentication.permissions.create_team.name",
   548  		"authentication.permissions.create_team.description",
   549  		PermissionScopeSystem,
   550  	}
   551  	PERMISSION_MANAGE_TEAM = &Permission{
   552  		"manage_team",
   553  		"authentication.permissions.manage_team.name",
   554  		"authentication.permissions.manage_team.description",
   555  		PermissionScopeTeam,
   556  	}
   557  	PERMISSION_IMPORT_TEAM = &Permission{
   558  		"import_team",
   559  		"authentication.permissions.import_team.name",
   560  		"authentication.permissions.import_team.description",
   561  		PermissionScopeTeam,
   562  	}
   563  	PERMISSION_VIEW_TEAM = &Permission{
   564  		"view_team",
   565  		"authentication.permissions.view_team.name",
   566  		"authentication.permissions.view_team.description",
   567  		PermissionScopeTeam,
   568  	}
   569  	PERMISSION_LIST_USERS_WITHOUT_TEAM = &Permission{
   570  		"list_users_without_team",
   571  		"authentication.permissions.list_users_without_team.name",
   572  		"authentication.permissions.list_users_without_team.description",
   573  		PermissionScopeSystem,
   574  	}
   575  	PERMISSION_CREATE_USER_ACCESS_TOKEN = &Permission{
   576  		"create_user_access_token",
   577  		"authentication.permissions.create_user_access_token.name",
   578  		"authentication.permissions.create_user_access_token.description",
   579  		PermissionScopeSystem,
   580  	}
   581  	PERMISSION_READ_USER_ACCESS_TOKEN = &Permission{
   582  		"read_user_access_token",
   583  		"authentication.permissions.read_user_access_token.name",
   584  		"authentication.permissions.read_user_access_token.description",
   585  		PermissionScopeSystem,
   586  	}
   587  	PERMISSION_REVOKE_USER_ACCESS_TOKEN = &Permission{
   588  		"revoke_user_access_token",
   589  		"authentication.permissions.revoke_user_access_token.name",
   590  		"authentication.permissions.revoke_user_access_token.description",
   591  		PermissionScopeSystem,
   592  	}
   593  	PERMISSION_CREATE_BOT = &Permission{
   594  		"create_bot",
   595  		"authentication.permissions.create_bot.name",
   596  		"authentication.permissions.create_bot.description",
   597  		PermissionScopeSystem,
   598  	}
   599  	PERMISSION_ASSIGN_BOT = &Permission{
   600  		"assign_bot",
   601  		"authentication.permissions.assign_bot.name",
   602  		"authentication.permissions.assign_bot.description",
   603  		PermissionScopeSystem,
   604  	}
   605  	PERMISSION_READ_BOTS = &Permission{
   606  		"read_bots",
   607  		"authentication.permissions.read_bots.name",
   608  		"authentication.permissions.read_bots.description",
   609  		PermissionScopeSystem,
   610  	}
   611  	PERMISSION_READ_OTHERS_BOTS = &Permission{
   612  		"read_others_bots",
   613  		"authentication.permissions.read_others_bots.name",
   614  		"authentication.permissions.read_others_bots.description",
   615  		PermissionScopeSystem,
   616  	}
   617  	PERMISSION_MANAGE_BOTS = &Permission{
   618  		"manage_bots",
   619  		"authentication.permissions.manage_bots.name",
   620  		"authentication.permissions.manage_bots.description",
   621  		PermissionScopeSystem,
   622  	}
   623  	PERMISSION_MANAGE_OTHERS_BOTS = &Permission{
   624  		"manage_others_bots",
   625  		"authentication.permissions.manage_others_bots.name",
   626  		"authentication.permissions.manage_others_bots.description",
   627  		PermissionScopeSystem,
   628  	}
   629  	PERMISSION_READ_JOBS = &Permission{
   630  		"read_jobs",
   631  		"authentication.permisssions.read_jobs.name",
   632  		"authentication.permisssions.read_jobs.description",
   633  		PermissionScopeSystem,
   634  	}
   635  	PERMISSION_MANAGE_JOBS = &Permission{
   636  		"manage_jobs",
   637  		"authentication.permisssions.manage_jobs.name",
   638  		"authentication.permisssions.manage_jobs.description",
   639  		PermissionScopeSystem,
   640  	}
   641  	PERMISSION_VIEW_MEMBERS = &Permission{
   642  		"view_members",
   643  		"authentication.permisssions.view_members.name",
   644  		"authentication.permisssions.view_members.description",
   645  		PermissionScopeTeam,
   646  	}
   647  	PERMISSION_INVITE_GUEST = &Permission{
   648  		"invite_guest",
   649  		"authentication.permissions.invite_guest.name",
   650  		"authentication.permissions.invite_guest.description",
   651  		PermissionScopeTeam,
   652  	}
   653  	PERMISSION_PROMOTE_GUEST = &Permission{
   654  		"promote_guest",
   655  		"authentication.permissions.promote_guest.name",
   656  		"authentication.permissions.promote_guest.description",
   657  		PermissionScopeSystem,
   658  	}
   659  	PERMISSION_DEMOTE_TO_GUEST = &Permission{
   660  		"demote_to_guest",
   661  		"authentication.permissions.demote_to_guest.name",
   662  		"authentication.permissions.demote_to_guest.description",
   663  		PermissionScopeSystem,
   664  	}
   665  	PERMISSION_USE_CHANNEL_MENTIONS = &Permission{
   666  		"use_channel_mentions",
   667  		"authentication.permissions.use_channel_mentions.name",
   668  		"authentication.permissions.use_channel_mentions.description",
   669  		PermissionScopeChannel,
   670  	}
   671  	PERMISSION_USE_GROUP_MENTIONS = &Permission{
   672  		"use_group_mentions",
   673  		"authentication.permissions.use_group_mentions.name",
   674  		"authentication.permissions.use_group_mentions.description",
   675  		PermissionScopeChannel,
   676  	}
   677  	PERMISSION_READ_OTHER_USERS_TEAMS = &Permission{
   678  		"read_other_users_teams",
   679  		"authentication.permissions.read_other_users_teams.name",
   680  		"authentication.permissions.read_other_users_teams.description",
   681  		PermissionScopeSystem,
   682  	}
   683  	PERMISSION_EDIT_BRAND = &Permission{
   684  		"edit_brand",
   685  		"authentication.permissions.edit_brand.name",
   686  		"authentication.permissions.edit_brand.description",
   687  		PermissionScopeSystem,
   688  	}
   689  	PERMISSION_SYSCONSOLE_READ_ABOUT = &Permission{
   690  		"sysconsole_read_about",
   691  		"authentication.permissions.use_group_mentions.name",
   692  		"authentication.permissions.use_group_mentions.description",
   693  		PermissionScopeSystem,
   694  	}
   695  	PERMISSION_SYSCONSOLE_WRITE_ABOUT = &Permission{
   696  		"sysconsole_write_about",
   697  		"authentication.permissions.use_group_mentions.name",
   698  		"authentication.permissions.use_group_mentions.description",
   699  		PermissionScopeSystem,
   700  	}
   701  	PERMISSION_SYSCONSOLE_READ_BILLING = &Permission{
   702  		"sysconsole_read_billing",
   703  		"",
   704  		"",
   705  		PermissionScopeSystem,
   706  	}
   707  	PERMISSION_SYSCONSOLE_WRITE_BILLING = &Permission{
   708  		"sysconsole_write_billing",
   709  		"",
   710  		"",
   711  		PermissionScopeSystem,
   712  	}
   713  	PERMISSION_SYSCONSOLE_READ_REPORTING = &Permission{
   714  		"sysconsole_read_reporting",
   715  		"authentication.permissions.use_group_mentions.name",
   716  		"authentication.permissions.use_group_mentions.description",
   717  		PermissionScopeSystem,
   718  	}
   719  	PERMISSION_SYSCONSOLE_WRITE_REPORTING = &Permission{
   720  		"sysconsole_write_reporting",
   721  		"authentication.permissions.use_group_mentions.name",
   722  		"authentication.permissions.use_group_mentions.description",
   723  		PermissionScopeSystem,
   724  	}
   725  	PERMISSION_SYSCONSOLE_READ_USERMANAGEMENT_USERS = &Permission{
   726  		"sysconsole_read_user_management_users",
   727  		"authentication.permissions.use_group_mentions.name",
   728  		"authentication.permissions.use_group_mentions.description",
   729  		PermissionScopeSystem,
   730  	}
   731  	PERMISSION_SYSCONSOLE_WRITE_USERMANAGEMENT_USERS = &Permission{
   732  		"sysconsole_write_user_management_users",
   733  		"authentication.permissions.use_group_mentions.name",
   734  		"authentication.permissions.use_group_mentions.description",
   735  		PermissionScopeSystem,
   736  	}
   737  	PERMISSION_SYSCONSOLE_READ_USERMANAGEMENT_GROUPS = &Permission{
   738  		"sysconsole_read_user_management_groups",
   739  		"authentication.permissions.use_group_mentions.name",
   740  		"authentication.permissions.use_group_mentions.description",
   741  		PermissionScopeSystem,
   742  	}
   743  	PERMISSION_SYSCONSOLE_WRITE_USERMANAGEMENT_GROUPS = &Permission{
   744  		"sysconsole_write_user_management_groups",
   745  		"authentication.permissions.use_group_mentions.name",
   746  		"authentication.permissions.use_group_mentions.description",
   747  		PermissionScopeSystem,
   748  	}
   749  	PERMISSION_SYSCONSOLE_READ_USERMANAGEMENT_TEAMS = &Permission{
   750  		"sysconsole_read_user_management_teams",
   751  		"authentication.permissions.use_group_mentions.name",
   752  		"authentication.permissions.use_group_mentions.description",
   753  		PermissionScopeSystem,
   754  	}
   755  	PERMISSION_SYSCONSOLE_WRITE_USERMANAGEMENT_TEAMS = &Permission{
   756  		"sysconsole_write_user_management_teams",
   757  		"authentication.permissions.use_group_mentions.name",
   758  		"authentication.permissions.use_group_mentions.description",
   759  		PermissionScopeSystem,
   760  	}
   761  	PERMISSION_SYSCONSOLE_READ_USERMANAGEMENT_CHANNELS = &Permission{
   762  		"sysconsole_read_user_management_channels",
   763  		"authentication.permissions.use_group_mentions.name",
   764  		"authentication.permissions.use_group_mentions.description",
   765  		PermissionScopeSystem,
   766  	}
   767  	PERMISSION_SYSCONSOLE_WRITE_USERMANAGEMENT_CHANNELS = &Permission{
   768  		"sysconsole_write_user_management_channels",
   769  		"authentication.permissions.use_group_mentions.name",
   770  		"authentication.permissions.use_group_mentions.description",
   771  		PermissionScopeSystem,
   772  	}
   773  	PERMISSION_SYSCONSOLE_READ_USERMANAGEMENT_PERMISSIONS = &Permission{
   774  		"sysconsole_read_user_management_permissions",
   775  		"authentication.permissions.use_group_mentions.name",
   776  		"authentication.permissions.use_group_mentions.description",
   777  		PermissionScopeSystem,
   778  	}
   779  	PERMISSION_SYSCONSOLE_WRITE_USERMANAGEMENT_PERMISSIONS = &Permission{
   780  		"sysconsole_write_user_management_permissions",
   781  		"authentication.permissions.use_group_mentions.name",
   782  		"authentication.permissions.use_group_mentions.description",
   783  		PermissionScopeSystem,
   784  	}
   785  	PERMISSION_SYSCONSOLE_READ_USERMANAGEMENT_SYSTEM_ROLES = &Permission{
   786  		"sysconsole_read_user_management_system_roles",
   787  		"authentication.permissions.use_group_mentions.name",
   788  		"authentication.permissions.use_group_mentions.description",
   789  		PermissionScopeSystem,
   790  	}
   791  	PERMISSION_SYSCONSOLE_WRITE_USERMANAGEMENT_SYSTEM_ROLES = &Permission{
   792  		"sysconsole_write_user_management_system_roles",
   793  		"authentication.permissions.use_group_mentions.name",
   794  		"authentication.permissions.use_group_mentions.description",
   795  		PermissionScopeSystem,
   796  	}
   797  	PERMISSION_SYSCONSOLE_READ_ENVIRONMENT = &Permission{
   798  		"sysconsole_read_environment",
   799  		"authentication.permissions.use_group_mentions.name",
   800  		"authentication.permissions.use_group_mentions.description",
   801  		PermissionScopeSystem,
   802  	}
   803  	PERMISSION_SYSCONSOLE_WRITE_ENVIRONMENT = &Permission{
   804  		"sysconsole_write_environment",
   805  		"authentication.permissions.use_group_mentions.name",
   806  		"authentication.permissions.use_group_mentions.description",
   807  		PermissionScopeSystem,
   808  	}
   809  	PERMISSION_SYSCONSOLE_READ_SITE = &Permission{
   810  		"sysconsole_read_site",
   811  		"authentication.permissions.use_group_mentions.name",
   812  		"authentication.permissions.use_group_mentions.description",
   813  		PermissionScopeSystem,
   814  	}
   815  	PERMISSION_SYSCONSOLE_WRITE_SITE = &Permission{
   816  		"sysconsole_write_site",
   817  		"authentication.permissions.use_group_mentions.name",
   818  		"authentication.permissions.use_group_mentions.description",
   819  		PermissionScopeSystem,
   820  	}
   821  	PERMISSION_SYSCONSOLE_READ_AUTHENTICATION = &Permission{
   822  		"sysconsole_read_authentication",
   823  		"authentication.permissions.use_group_mentions.name",
   824  		"authentication.permissions.use_group_mentions.description",
   825  		PermissionScopeSystem,
   826  	}
   827  	PERMISSION_SYSCONSOLE_WRITE_AUTHENTICATION = &Permission{
   828  		"sysconsole_write_authentication",
   829  		"authentication.permissions.use_group_mentions.name",
   830  		"authentication.permissions.use_group_mentions.description",
   831  		PermissionScopeSystem,
   832  	}
   833  	PERMISSION_SYSCONSOLE_READ_PLUGINS = &Permission{
   834  		"sysconsole_read_plugins",
   835  		"authentication.permissions.use_group_mentions.name",
   836  		"authentication.permissions.use_group_mentions.description",
   837  		PermissionScopeSystem,
   838  	}
   839  	PERMISSION_SYSCONSOLE_WRITE_PLUGINS = &Permission{
   840  		"sysconsole_write_plugins",
   841  		"authentication.permissions.use_group_mentions.name",
   842  		"authentication.permissions.use_group_mentions.description",
   843  		PermissionScopeSystem,
   844  	}
   845  	PERMISSION_SYSCONSOLE_READ_INTEGRATIONS = &Permission{
   846  		"sysconsole_read_integrations",
   847  		"authentication.permissions.use_group_mentions.name",
   848  		"authentication.permissions.use_group_mentions.description",
   849  		PermissionScopeSystem,
   850  	}
   851  	PERMISSION_SYSCONSOLE_WRITE_INTEGRATIONS = &Permission{
   852  		"sysconsole_write_integrations",
   853  		"authentication.permissions.use_group_mentions.name",
   854  		"authentication.permissions.use_group_mentions.description",
   855  		PermissionScopeSystem,
   856  	}
   857  	PERMISSION_SYSCONSOLE_READ_COMPLIANCE = &Permission{
   858  		"sysconsole_read_compliance",
   859  		"authentication.permissions.use_group_mentions.name",
   860  		"authentication.permissions.use_group_mentions.description",
   861  		PermissionScopeSystem,
   862  	}
   863  	PERMISSION_SYSCONSOLE_WRITE_COMPLIANCE = &Permission{
   864  		"sysconsole_write_compliance",
   865  		"authentication.permissions.use_group_mentions.name",
   866  		"authentication.permissions.use_group_mentions.description",
   867  		PermissionScopeSystem,
   868  	}
   869  	PERMISSION_SYSCONSOLE_READ_PLUGINS = &Permission{
   870  		"sysconsole_read_plugins",
   871  		"authentication.permissions.use_group_mentions.name",
   872  		"authentication.permissions.use_group_mentions.description",
   873  		PermissionScopeSystem,
   874  	}
   875  	PERMISSION_SYSCONSOLE_WRITE_PLUGINS = &Permission{
   876  		"sysconsole_write_plugins",
   877  		"authentication.permissions.use_group_mentions.name",
   878  		"authentication.permissions.use_group_mentions.description",
   879  		PermissionScopeSystem,
   880  	}
   881  	PERMISSION_SYSCONSOLE_READ_EXPERIMENTAL = &Permission{
   882  		"sysconsole_read_experimental",
   883  		"authentication.permissions.use_group_mentions.name",
   884  		"authentication.permissions.use_group_mentions.description",
   885  		PermissionScopeSystem,
   886  	}
   887  	PERMISSION_SYSCONSOLE_WRITE_EXPERIMENTAL = &Permission{
   888  		"sysconsole_write_experimental",
   889  		"authentication.permissions.use_group_mentions.name",
   890  		"authentication.permissions.use_group_mentions.description",
   891  		PermissionScopeSystem,
   892  	}
   893  
   894  	SysconsoleReadPermissions = []*Permission{
   895  		PERMISSION_SYSCONSOLE_READ_ABOUT,
   896  		PERMISSION_SYSCONSOLE_READ_BILLING,
   897  		PERMISSION_SYSCONSOLE_READ_REPORTING,
   898  		PERMISSION_SYSCONSOLE_READ_USERMANAGEMENT_USERS,
   899  		PERMISSION_SYSCONSOLE_READ_USERMANAGEMENT_GROUPS,
   900  		PERMISSION_SYSCONSOLE_READ_USERMANAGEMENT_TEAMS,
   901  		PERMISSION_SYSCONSOLE_READ_USERMANAGEMENT_CHANNELS,
   902  		PERMISSION_SYSCONSOLE_READ_USERMANAGEMENT_PERMISSIONS,
   903  		PERMISSION_SYSCONSOLE_READ_USERMANAGEMENT_SYSTEM_ROLES,
   904  		PERMISSION_SYSCONSOLE_READ_ENVIRONMENT,
   905  		PERMISSION_SYSCONSOLE_READ_SITE,
   906  		PERMISSION_SYSCONSOLE_READ_AUTHENTICATION,
   907  		PERMISSION_SYSCONSOLE_READ_PLUGINS,
   908  		PERMISSION_SYSCONSOLE_READ_INTEGRATIONS,
   909  		PERMISSION_SYSCONSOLE_READ_COMPLIANCE,
   910  		PERMISSION_SYSCONSOLE_READ_EXPERIMENTAL,
   911  	}
   912  
   913  	SysconsoleWritePermissions = []*Permission{
   914  		PERMISSION_SYSCONSOLE_WRITE_ABOUT,
   915  		PERMISSION_SYSCONSOLE_WRITE_BILLING,
   916  		PERMISSION_SYSCONSOLE_WRITE_REPORTING,
   917  		PERMISSION_SYSCONSOLE_WRITE_USERMANAGEMENT_USERS,
   918  		PERMISSION_SYSCONSOLE_WRITE_USERMANAGEMENT_GROUPS,
   919  		PERMISSION_SYSCONSOLE_WRITE_USERMANAGEMENT_TEAMS,
   920  		PERMISSION_SYSCONSOLE_WRITE_USERMANAGEMENT_CHANNELS,
   921  		PERMISSION_SYSCONSOLE_WRITE_USERMANAGEMENT_PERMISSIONS,
   922  		PERMISSION_SYSCONSOLE_WRITE_USERMANAGEMENT_SYSTEM_ROLES,
   923  		PERMISSION_SYSCONSOLE_WRITE_ENVIRONMENT,
   924  		PERMISSION_SYSCONSOLE_WRITE_SITE,
   925  		PERMISSION_SYSCONSOLE_WRITE_AUTHENTICATION,
   926  		PERMISSION_SYSCONSOLE_WRITE_PLUGINS,
   927  		PERMISSION_SYSCONSOLE_WRITE_INTEGRATIONS,
   928  		PERMISSION_SYSCONSOLE_WRITE_COMPLIANCE,
   929  		PERMISSION_SYSCONSOLE_WRITE_EXPERIMENTAL,
   930  	}
   931  
   932  	SystemScopedPermissionsMinusSysconsole := []*Permission{
   933  		PERMISSION_ASSIGN_SYSTEM_ADMIN_ROLE,
   934  		PERMISSION_MANAGE_ROLES,
   935  		PERMISSION_MANAGE_SYSTEM,
   936  		PERMISSION_CREATE_DIRECT_CHANNEL,
   937  		PERMISSION_CREATE_GROUP_CHANNEL,
   938  		PERMISSION_LIST_PUBLIC_TEAMS,
   939  		PERMISSION_JOIN_PUBLIC_TEAMS,
   940  		PERMISSION_LIST_PRIVATE_TEAMS,
   941  		PERMISSION_JOIN_PRIVATE_TEAMS,
   942  		PERMISSION_EDIT_OTHER_USERS,
   943  		PERMISSION_READ_OTHER_USERS_TEAMS,
   944  		PERMISSION_GET_PUBLIC_LINK,
   945  		PERMISSION_MANAGE_OAUTH,
   946  		PERMISSION_MANAGE_SYSTEM_WIDE_OAUTH,
   947  		PERMISSION_CREATE_TEAM,
   948  		PERMISSION_LIST_USERS_WITHOUT_TEAM,
   949  		PERMISSION_CREATE_USER_ACCESS_TOKEN,
   950  		PERMISSION_READ_USER_ACCESS_TOKEN,
   951  		PERMISSION_REVOKE_USER_ACCESS_TOKEN,
   952  		PERMISSION_CREATE_BOT,
   953  		PERMISSION_ASSIGN_BOT,
   954  		PERMISSION_READ_BOTS,
   955  		PERMISSION_READ_OTHERS_BOTS,
   956  		PERMISSION_MANAGE_BOTS,
   957  		PERMISSION_MANAGE_OTHERS_BOTS,
   958  		PERMISSION_READ_JOBS,
   959  		PERMISSION_MANAGE_JOBS,
   960  		PERMISSION_PROMOTE_GUEST,
   961  		PERMISSION_DEMOTE_TO_GUEST,
   962  		PERMISSION_EDIT_BRAND,
   963  		PERMISSION_MANAGE_SHARED_CHANNELS,
   964  		PERMISSION_MANAGE_REMOTE_CLUSTERS,
   965  	}
   966  
   967  	TeamScopedPermissions := []*Permission{
   968  		PERMISSION_INVITE_USER,
   969  		PERMISSION_ADD_USER_TO_TEAM,
   970  		PERMISSION_MANAGE_SLASH_COMMANDS,
   971  		PERMISSION_MANAGE_OTHERS_SLASH_COMMANDS,
   972  		PERMISSION_CREATE_PUBLIC_CHANNEL,
   973  		PERMISSION_CREATE_PRIVATE_CHANNEL,
   974  		PERMISSION_MANAGE_TEAM_ROLES,
   975  		PERMISSION_LIST_TEAM_CHANNELS,
   976  		PERMISSION_JOIN_PUBLIC_CHANNELS,
   977  		PERMISSION_READ_PUBLIC_CHANNEL,
   978  		PERMISSION_MANAGE_INCOMING_WEBHOOKS,
   979  		PERMISSION_MANAGE_OUTGOING_WEBHOOKS,
   980  		PERMISSION_MANAGE_OTHERS_INCOMING_WEBHOOKS,
   981  		PERMISSION_MANAGE_OTHERS_OUTGOING_WEBHOOKS,
   982  		PERMISSION_CREATE_EMOJIS,
   983  		PERMISSION_DELETE_EMOJIS,
   984  		PERMISSION_DELETE_OTHERS_EMOJIS,
   985  		PERMISSION_REMOVE_USER_FROM_TEAM,
   986  		PERMISSION_MANAGE_TEAM,
   987  		PERMISSION_IMPORT_TEAM,
   988  		PERMISSION_VIEW_TEAM,
   989  		PERMISSION_VIEW_MEMBERS,
   990  		PERMISSION_INVITE_GUEST,
   991  	}
   992  
   993  	ChannelScopedPermissions := []*Permission{
   994  		PERMISSION_USE_SLASH_COMMANDS,
   995  		PERMISSION_MANAGE_PUBLIC_CHANNEL_MEMBERS,
   996  		PERMISSION_MANAGE_PRIVATE_CHANNEL_MEMBERS,
   997  		PERMISSION_MANAGE_CHANNEL_ROLES,
   998  		PERMISSION_MANAGE_PUBLIC_CHANNEL_PROPERTIES,
   999  		PERMISSION_MANAGE_PRIVATE_CHANNEL_PROPERTIES,
  1000  		PERMISSION_CONVERT_PUBLIC_CHANNEL_TO_PRIVATE,
  1001  		PERMISSION_CONVERT_PRIVATE_CHANNEL_TO_PUBLIC,
  1002  		PERMISSION_DELETE_PUBLIC_CHANNEL,
  1003  		PERMISSION_DELETE_PRIVATE_CHANNEL,
  1004  		PERMISSION_READ_CHANNEL,
  1005  		PERMISSION_READ_PUBLIC_CHANNEL_GROUPS,
  1006  		PERMISSION_READ_PRIVATE_CHANNEL_GROUPS,
  1007  		PERMISSION_ADD_REACTION,
  1008  		PERMISSION_REMOVE_REACTION,
  1009  		PERMISSION_REMOVE_OTHERS_REACTIONS,
  1010  		PERMISSION_UPLOAD_FILE,
  1011  		PERMISSION_CREATE_POST,
  1012  		PERMISSION_CREATE_POST_PUBLIC,
  1013  		PERMISSION_CREATE_POST_EPHEMERAL,
  1014  		PERMISSION_EDIT_POST,
  1015  		PERMISSION_EDIT_OTHERS_POSTS,
  1016  		PERMISSION_DELETE_POST,
  1017  		PERMISSION_DELETE_OTHERS_POSTS,
  1018  		PERMISSION_USE_CHANNEL_MENTIONS,
  1019  		PERMISSION_USE_GROUP_MENTIONS,
  1020  	}
  1021  
  1022  	DeprecatedPermissions = []*Permission{
  1023  		PERMISSION_PERMANENT_DELETE_USER,
  1024  		PERMISSION_MANAGE_WEBHOOKS,
  1025  		PERMISSION_MANAGE_OTHERS_WEBHOOKS,
  1026  		PERMISSION_MANAGE_EMOJIS,
  1027  		PERMISSION_MANAGE_OTHERS_EMOJIS,
  1028  	}
  1029  
  1030  	AllPermissions = []*Permission{}
  1031  	AllPermissions = append(AllPermissions, SystemScopedPermissionsMinusSysconsole...)
  1032  	AllPermissions = append(AllPermissions, TeamScopedPermissions...)
  1033  	AllPermissions = append(AllPermissions, ChannelScopedPermissions...)
  1034  	AllPermissions = append(AllPermissions, SysconsoleReadPermissions...)
  1035  	AllPermissions = append(AllPermissions, SysconsoleWritePermissions...)
  1036  
  1037  	ChannelModeratedPermissions = []string{
  1038  		PERMISSION_CREATE_POST.Id,
  1039  		"create_reactions",
  1040  		"manage_members",
  1041  		PERMISSION_USE_CHANNEL_MENTIONS.Id,
  1042  	}
  1043  
  1044  	ChannelModeratedPermissionsMap = map[string]string{
  1045  		PERMISSION_CREATE_POST.Id:                    ChannelModeratedPermissions[0],
  1046  		PERMISSION_ADD_REACTION.Id:                   ChannelModeratedPermissions[1],
  1047  		PERMISSION_REMOVE_REACTION.Id:                ChannelModeratedPermissions[1],
  1048  		PERMISSION_MANAGE_PUBLIC_CHANNEL_MEMBERS.Id:  ChannelModeratedPermissions[2],
  1049  		PERMISSION_MANAGE_PRIVATE_CHANNEL_MEMBERS.Id: ChannelModeratedPermissions[2],
  1050  		PERMISSION_USE_CHANNEL_MENTIONS.Id:           ChannelModeratedPermissions[3],
  1051  	}
  1052  }
  1053  
  1054  func init() {
  1055  	initializePermissions()
  1056  }