-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdescriptor.php
75 lines (54 loc) · 1.73 KB
/
descriptor.php
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
<?php
namespace Icybee\Modules\Users;
use ICanBoogie\ActiveRecord\Model;
use ICanBoogie\Module\Descriptor;
return [
Descriptor::ID => 'users',
Descriptor::DESCRIPTION => 'User management',
Descriptor::CATEGORY => 'users',
Descriptor::MODELS => [
'primary' => [
Model::SCHEMA => [
'uid' => 'serial',
'constructor' => [ 'varchar', 64, 'indexed' => true ],
'email' => [ 'varchar', 64, 'unique' => true ],
'password_hash' => [ 'varchar', 255, 'charset' => 'ascii/bin' ],
'username' => [ 'varchar', 32, 'unique' => true ],
'firstname' => [ 'varchar', 32 ],
'lastname' => [ 'varchar', 32 ],
'nickname' => [ 'varchar', 32 ],
'name_as' => [ 'integer', 'tiny' ],
'language' => [ 'varchar', 8 ],
'timezone' => [ 'varchar', 32 ],
'logged_at' => 'datetime',
'created_at' => [ 'timestamp', 'default' => 'CURRENT_TIMESTAMP' ],
'is_activated' => [ 'boolean', 'indexed' => true ]
]
],
'has_many_roles' => [
Model::ALIAS => 'has_many_roles',
Model::ACTIVERECORD_CLASS => 'ICanBoogie\ActiveRecord',
Model::CLASSNAME => 'ICanBoogie\ActiveRecord\Model',
Model::SCHEMA => [
'uid' => [ 'foreign', 'primary' => true ],
'rid' => [ 'foreign', 'primary' => true ]
]
],
'has_many_sites' => [
Model::ALIAS => 'has_many_sites',
Model::ACTIVERECORD_CLASS => 'ICanBoogie\ActiveRecord',
Model::CLASSNAME => 'ICanBoogie\ActiveRecord\Model',
Model::SCHEMA => [
'uid' => [ 'foreign', 'primary' => true ],
'site_id' => [ 'foreign', 'primary' => true ]
]
]
],
Descriptor::NS => __NAMESPACE__,
Descriptor::PERMISSIONS => [
'modify own profile'
],
Descriptor::REQUIRED => true,
Descriptor::REQUIRES => [ 'users.roles' ],
Descriptor::TITLE => "Users"
];