add role teacher to application_policy, implement teacher into team_policy
This commit is contained in:
@ -4,6 +4,11 @@ class ApplicationPolicy
|
|||||||
end
|
end
|
||||||
private :admin?
|
private :admin?
|
||||||
|
|
||||||
|
def teacher?
|
||||||
|
@user.teacher?
|
||||||
|
end
|
||||||
|
private :teacher?
|
||||||
|
|
||||||
def everyone
|
def everyone
|
||||||
true
|
true
|
||||||
end
|
end
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
class TeamPolicy < ApplicationPolicy
|
class TeamPolicy < ApplicationPolicy
|
||||||
[:create?, :index?, :new?].each do |action|
|
[:create?, :index?, :new?].each do |action|
|
||||||
define_method(action) { admin? }
|
define_method(action) { admin? || teacher? }
|
||||||
end
|
end
|
||||||
|
|
||||||
[:destroy?, :edit?, :show?, :update?].each do |action|
|
[:destroy?, :edit?, :show?, :update?].each do |action|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
class Xikolo::3Client
|
class Xikolo::Client
|
||||||
def self.get_user(user_id)
|
def self.get_user(user_id)
|
||||||
params = {:user_id => user_id}
|
params = {:user_id => user_id}
|
||||||
response = get_request(user_profile_url(user_id), params)
|
response = get_request(user_profile_url(user_id), params)
|
||||||
|
Reference in New Issue
Block a user