-
Notifications
You must be signed in to change notification settings - Fork 8
/
group_schema.php
57 lines (50 loc) · 2.14 KB
/
group_schema.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
<?php
/*
All Emoncms code is released under the GNU Affero General Public License.
See COPYRIGHT.txt and LICENSE.txt.
---------------------------------------------------------------------
Emoncms - open source energy visualisation
Part of the OpenEnergyMonitor project:
http://openenergymonitor.org
Group module has been developed by Carbon Co-op
https://carbon.coop/
*/
/* * ******************************************************
* groups table
*
* - visibility:
* - public: can be found on searches
* - private: cannot be found in searches
* - access:
* - open: everybody can join
* - closed: join by requests
*
* ***************************************************** */
$schema['groups'] = array(
'id' => array('type' => 'int(11)', 'Null' => 'NO', 'Key' => 'PRI', 'Extra' => 'auto_increment'),
'name' => array('type' => 'varchar(64)'),
'description' => array('type' => 'varchar(256)'),
'organization' => array('type' => 'varchar(64)'),
'area' => array('type' => 'varchar(64)'),
'visibility' => array('type' => 'varchar(16)'),
'access' => array('type' => 'varchar(16)')
);
/* * ******************************************************
* group_users table
*
* - role:
* 0 - passive member: just a normal user with no access to anything in the group. The aim of the user is to be managed by the group administrator
* 1 - administrator: full access (create user, add member, create group feeds, dashboards graphs, etc)
* 2 - sub-administrator (community member): view access to the list of members, write access to group graphs.
* 3 - member: view access to dashboards
* - admin_rights: administrator's rights over user's data
* - full: Full access to member's account (login, change password, create feeds, etc)
* - read: Read and list access to member's public feeds
*
* ***************************************************** */
$schema['group_users'] = array(
'groupid' => array('type' => 'int(11)'),
'userid' => array('type' => 'int(11)'),
'role' => array('type' => 'int(1)'),
'admin_rights' => array('type' => 'varchar(16)')
);