#1585 Api for user creation: base implementation

This commit is contained in:
Valeriy Sizov 2012-10-02 12:46:01 +03:00
parent 0187ae4e86
commit 825081174a
2 changed files with 30 additions and 0 deletions

View file

@ -22,6 +22,10 @@ module Gitlab
unauthorized! unless current_user
end
def authenticated_as_admin!
forbidden! unless current_user.is_admin?
end
def authorize! action, subject
unless abilities.allowed?(current_user, action, subject)
forbidden!