summaryrefslogtreecommitdiffstats
path: root/acf/modules/aaa.lua
blob: f8e28caba1aacd4cf586fca1cac10666f50c97f3 (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
--[[
Copyright (c) 2012 Kaarle Ritvanen
See LICENSE file for license details
--]]

module(..., package.seeall)

local M = require('acf.model')

Role = M.new()
Role.permissions = M.Collection{type=M.Reference{scope='../../permissions'}}

User = M.new()
User.password = M.String
User.real_name = M.String
User.roles = M.Collection{type=M.Reference{scope='../../roles'}}

Authentication = M.new()
Authentication.users = M.Collection{type=User}
Authentication.roles = M.Collection{type=Role}
Authentication.permissions = M.PrimitiveList{type=M.String}

M.register('auth',
	   '/json'..require('lfs').currentdir()..'/config/aaa.json',
	   Authentication)