Method: Osm::Api#get_user_permissions
- Defined in:
- lib/osm/api.rb
#get_user_permissions(options = {}) ⇒ Object
Get API user’s permissions
225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 |
# File 'lib/osm/api.rb', line 225 def (={}) cache_key = ['permissions', user_id] if ![:no_cache] && Osm::Model.cache_exist?(self, cache_key) return Osm::Model.cache_read(self, cache_key) end = Hash.new get_user_roles().each do |item| unless item['section'].eql?('discount') # It's not an actual section .merge!(Osm::to_i_or_nil(item['sectionid']) => Osm.(item['permissions'])) end end Osm::Model.cache_write(self, cache_key, ) return end |