emqx_dashboard_rbac.hrl 1.4 KB

123456789101112131415161718192021222324252627282930313233
  1. %%--------------------------------------------------------------------
  2. %% Copyright (c) 2023-2024 EMQ Technologies Co., Ltd. All Rights Reserved.
  3. %%
  4. %% Licensed under the Apache License, Version 2.0 (the "License");
  5. %% you may not use this file except in compliance with the License.
  6. %% You may obtain a copy of the License at
  7. %%
  8. %% http://www.apache.org/licenses/LICENSE-2.0
  9. %%
  10. %% Unless required by applicable law or agreed to in writing, software
  11. %% distributed under the License is distributed on an "AS IS" BASIS,
  12. %% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. %% See the License for the specific language governing permissions and
  14. %% limitations under the License.
  15. %%--------------------------------------------------------------------
  16. -ifndef(EMQX_DASHBOARD_RBAC).
  17. -define(EMQX_DASHBOARD_RBAC, true).
  18. %% TODO:
  19. %% The predefined roles of the preliminary RBAC implementation,
  20. %% these may be removed when developing the full RBAC feature.
  21. %% In full RBAC feature, the role may be customised created and deleted,
  22. %% a predefined configuration would replace these macros.
  23. -define(ROLE_VIEWER, <<"viewer">>).
  24. -define(ROLE_SUPERUSER, <<"administrator">>).
  25. -define(ROLE_DEFAULT, ?ROLE_SUPERUSER).
  26. -define(ROLE_API_VIEWER, <<"viewer">>).
  27. -define(ROLE_API_SUPERUSER, <<"administrator">>).
  28. -define(ROLE_API_PUBLISHER, <<"publisher">>).
  29. -define(ROLE_API_DEFAULT, ?ROLE_API_SUPERUSER).
  30. -endif.