Sha256: ec4f96dc8989f408d2b8fcf07f0bc772ac07144c687244cd4207c7b76e426eed
Contents?: true
Size: 452 Bytes
Versions: 35
Compression:
Stored size: 452 Bytes
Contents
module Scrivito class Session def self.renew(id, user) payload = { session: { role: 'editor', user_id: user.id, permissions: permissions(user), }, } CmsRestApi.task_unaware_request(:put, "sessions/#{id}", payload) end def self.permissions(user) Hash[user.explicit_rules.map do |permission, verb, _, _| [verb, permission.to_s] end] end private_class_method :permissions end end
Version data entries
35 entries across 35 versions & 1 rubygems