forked from Simnation/Main
20 lines
346 B
JavaScript
20 lines
346 B
JavaScript
![]() |
class Rights{
|
||
|
constructor(rights){
|
||
|
this.fullright = "*"
|
||
|
this.rights = rights;
|
||
|
}
|
||
|
|
||
|
has(right_key){
|
||
|
let retval = false;
|
||
|
|
||
|
if(this.rights[right_key] !== undefined){
|
||
|
retval = this.rights[right_key];
|
||
|
}
|
||
|
|
||
|
if(!retval && this.rights["*"] !== undefined){
|
||
|
retval = this.rights["*"]
|
||
|
}
|
||
|
|
||
|
return retval;
|
||
|
}
|
||
|
}
|