Stage 3.2 + tests
This commit is contained in:
@@ -66,10 +66,12 @@ delete_calendar(UserId, CalendarId) ->
|
||||
Error
|
||||
end.
|
||||
|
||||
%% Проверка прав доступа
|
||||
can_access(_UserId, #calendar{status = active}) -> true;
|
||||
%% Проверка прав доступа (просмотр)
|
||||
can_access(UserId, #calendar{owner_id = UserId, status = active}) -> true;
|
||||
can_access(_UserId, #calendar{type = commercial, status = active}) -> true;
|
||||
can_access(_UserId, _) -> false.
|
||||
|
||||
%% Проверка прав редактирования
|
||||
can_edit(UserId, #calendar{owner_id = UserId, status = active}) -> true;
|
||||
can_edit(_, _) -> false.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user