blob: 170437684627e896e0fe72c57ba499f91c7d98e2 (
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
|
--[[
Copyright (c) 2012-2013 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'}}
function User:check_password(password) return password == self.password end
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)
|