Module: Authorizable::ModelMethods::ContainerInstanceMethods

Defined in:
lib/authorizable.rb

Instance Method Summary (collapse)

Instance Method Details

- (Object) accepting_action(user, action, container, spe_cond = false, sys_cond = false, ws_cond = true)



184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
# File 'lib/authorizable.rb', line 184

def accepting_action(user, action, container, spe_cond=false, sys_cond=false, ws_cond=true)
	# Special access
	if user.has_system_role('superadmin') || spe_cond
		return true
	end
	# System access
	if user.has_system_permission(self.class.to_s.underscore, action) || sys_cond
		return true
	end
	# Workspace access
	# Not for new and index normally ...
	if self.users.include?(user)
		if user.has_container_permission(self.id, self.class.to_s.underscore, action, container) && ws_cond
			return true
		end
	end
	false
end