summaryrefslogtreecommitdiffstats
path: root/app/acf-util/roles-model.lua
blob: 95f28d1a92d47e480964f5832c04287b63f73cb4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
-- Roles/Group  model functions

require ("session")
require ("roles")

module (..., package.seeall)

read = function(self,sessionid)
	useid , theroles = session.check_session(conf.sessiondir,sessionid,"roles")
--we need to expand roles to give us real perm list
	perm = roles.get_roles_perm(self,theroles)
	return ( cfe { userid={value=useid,name="userid"},roles={ value=theroles,name="roles"}, perm={value=perm,name="perm"},{value=self.conf,name="self"},{value=sessiondata.userinfo.perm,name="perm2"} })	
end

getcont = function(self)
	--need to get a list of all the controllers
	--t = roles.get_controllers(self,"skins")	
	bobo = roles.get_controllers(self)
	local table_m = {}
	for a,b in pairs(bobo) do
	temp = roles.get_controllers_func(self,b)
	table_m[b.sname] = temp
	end

	return (cfe {value=table_m,name="mtable"})

end