Ролевая модель и аудит Часть 1.

This commit is contained in:
2026-04-28 19:12:02 +03:00
parent 7ea4efd7d9
commit b2cea7896d
32 changed files with 369 additions and 320 deletions

13
src/infra/admin_utils.erl Normal file
View File

@@ -0,0 +1,13 @@
-module(admin_utils).
-include("records.hrl").
-export([is_admin/1]).
is_admin(UserId) ->
case core_admin:get_by_id(UserId) of
{ok, User} ->
Role = User#admin.role,
Role =:= admin orelse Role =:= superadmin orelse
Role =:= moderator orelse Role =:= support;
_ -> false
end.