--[[ 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.Set{type=M.Reference{scope='../../../permissions'}} User = M.new() User.password = M.String User.real_name = M.String User.roles = M.Set{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.Set{type=M.String} M.register('auth', '/json'..require('lfs').currentdir()..'/config/aaa.json', Authentication)