fix app authorized
This commit is contained in:
parent
9205f47590
commit
feefc99db8
|
@ -353,9 +353,9 @@ module OrbitBackendHelper
|
||||||
def is_authorized(object)
|
def is_authorized(object)
|
||||||
autorized = @module_app.authorizable_models.inject(false) do |autorized, klass|
|
autorized = @module_app.authorizable_models.inject(false) do |autorized, klass|
|
||||||
if object.is_a?(klass.constantize)
|
if object.is_a?(klass.constantize)
|
||||||
autorized ||= object.user_can_sub_manage?(current_user)
|
autorized ||= (object.user_can_sub_manage?(current_user) and object.create_user_id == current_user.id)
|
||||||
else
|
else
|
||||||
autorized ||= object.send(klass.underscore).user_can_sub_manage?(current_user)
|
autorized ||= (object.send(klass.underscore).user_can_sub_manage?(current_user) and object.create_user_id == current_user.id)
|
||||||
end
|
end
|
||||||
autorized
|
autorized
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue