First commit
This commit is contained in:
24
application/user/group/user.group.admin.js
Normal file
24
application/user/group/user.group.admin.js
Normal file
@@ -0,0 +1,24 @@
|
||||
|
||||
import option from '/elements/option.js';
|
||||
|
||||
import datatype from '/unify/datatype.js';
|
||||
|
||||
|
||||
|
||||
export default class admin extends option {
|
||||
|
||||
|
||||
value = 1.0;
|
||||
|
||||
label = "Admin";
|
||||
|
||||
type = "userGroup";
|
||||
|
||||
constructor() {
|
||||
|
||||
super();
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
137
application/user/group/user.group.js
Normal file
137
application/user/group/user.group.js
Normal file
@@ -0,0 +1,137 @@
|
||||
|
||||
|
||||
import collection from "/unify/collection.js";
|
||||
import datatype from '/unify/datatype.js';
|
||||
|
||||
|
||||
import option from '/elements/option.js';
|
||||
|
||||
|
||||
|
||||
class visitor extends option{
|
||||
|
||||
value = 2.0;
|
||||
|
||||
label = "Visitor";
|
||||
|
||||
type = "userGroup";
|
||||
|
||||
constructor() {
|
||||
|
||||
super();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
class member extends option{
|
||||
|
||||
value = 0.0;
|
||||
|
||||
ander = 0.0;
|
||||
|
||||
label = "Member";
|
||||
|
||||
type = "userGroup";
|
||||
|
||||
constructor() {
|
||||
|
||||
super();
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
class admin extends option {
|
||||
|
||||
value = 1.0;
|
||||
|
||||
label = "Admin";
|
||||
|
||||
type = "userGroup";
|
||||
|
||||
constructor() {
|
||||
|
||||
super();
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
export default class groups {
|
||||
|
||||
datatype = 'TEXT';
|
||||
|
||||
value = 2.0;
|
||||
|
||||
enabled = false;
|
||||
|
||||
type = "column"
|
||||
|
||||
change() {
|
||||
|
||||
var children = this.getChildren();
|
||||
|
||||
for(var c = 0; c<children.length; c++) {
|
||||
|
||||
var child = children[ c ];
|
||||
|
||||
if( child.customElement.selected ) {
|
||||
|
||||
this.value = child.customElement.value;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
create() {
|
||||
|
||||
this.customElement.value = parseFloat( this.value );
|
||||
// the code here under is redundant, There is still an error, bug that needs to be resolved.
|
||||
/*
|
||||
var children = this.getChildren();
|
||||
|
||||
for (var i = 0; i < children.length; i++) {
|
||||
|
||||
var child = children[i];
|
||||
|
||||
if( child.type == "userGroup" ) {
|
||||
|
||||
var childValue = child.value
|
||||
|
||||
// todo bug this should be 0.0 but is false
|
||||
if(! childValue ) {
|
||||
|
||||
childValue = 0.0
|
||||
}
|
||||
|
||||
console.log(childValue,parseFloat( this.value ), childValue==parseFloat( this.value ) );
|
||||
|
||||
if( childValue == parseFloat( this.value ) ) {
|
||||
console.log(child.customElement);
|
||||
child.customElement.setAttribute("selected", "true")
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
}
|
||||
|
||||
member = new member();
|
||||
|
||||
admin = new admin();
|
||||
|
||||
visitor = new visitor();
|
||||
|
||||
}
|
||||
|
||||
|
||||
4
application/user/group/user.group.permission.js
Normal file
4
application/user/group/user.group.permission.js
Normal file
@@ -0,0 +1,4 @@
|
||||
|
||||
import groups from './user.group.js';
|
||||
|
||||
export default new groups();
|
||||
22
application/user/group/user.group.visitor.js
Normal file
22
application/user/group/user.group.visitor.js
Normal file
@@ -0,0 +1,22 @@
|
||||
|
||||
import option from '/elements/option.js';
|
||||
|
||||
|
||||
export default class visitor extends option{
|
||||
|
||||
value = 2.0;
|
||||
|
||||
label = "Member";
|
||||
|
||||
color = "black";
|
||||
|
||||
type = "userGroup";
|
||||
|
||||
constructor() {
|
||||
|
||||
super();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user