void
updatePermissions(List data)
Source
void updatePermissions(List data) {
idMatchs.clear();
groupMatchs.clear();
defaultPermission = Permission.NONE;
for (Object obj in data) {
if (obj is Map) {
if (obj['id'] is String) {
idMatchs[obj['id']] = Permission.nameParser[obj['permission']];
} else if (obj['group'] is String) {
if (obj['group'] == 'default') {
defaultPermission = Permission.nameParser[obj['permission']];
} else {
groupMatchs[obj['group']] =
Permission.nameParser[obj['permission']];
}
}
}
}
}