This reverts commit ab292c62088be409eb6f93bd86445212837bf39c.pull/9957/head
parent
c3c77d1ea4
commit
9c13f2667d
@ -1,24 +0,0 @@ |
||||
module ::Bim |
||||
module Views |
||||
class ContractStrategy < ::BaseContract |
||||
validate :manageable |
||||
|
||||
private |
||||
|
||||
def manageable |
||||
return if model.query.blank? |
||||
|
||||
errors.add(:base, :error_unauthorized) unless query_permissions? |
||||
end |
||||
|
||||
def query_permissions? |
||||
# TODO: This currently does not differentiate between public and private queries since it isn't specified yet. |
||||
user_allowed_on_query?(:manage_ifc_models) |
||||
end |
||||
|
||||
def user_allowed_on_query?(permission) |
||||
user.allowed_to?(permission, model.query.project, global: model.query.project.nil?) |
||||
end |
||||
end |
||||
end |
||||
end |
Loading…
Reference in new issue