Fixed permission switch #2
This commit is contained in:
parent
2ed0721af3
commit
dab4c40209
@ -342,9 +342,9 @@ std::shared_ptr<v2::PermissionManager> DatabaseHelper::loadClientPermissionManag
|
|||||||
auto channel = perm->channelId > 0 ? server->getChannelTree()->findChannel(perm->channelId) : nullptr;
|
auto channel = perm->channelId > 0 ? server->getChannelTree()->findChannel(perm->channelId) : nullptr;
|
||||||
|
|
||||||
if(channel)
|
if(channel)
|
||||||
pMgr->load_permission(perm->permission->type, {perm->value, perm->grant}, channel->channelId(), perm->flag_negate, perm->flag_skip, perm->value != permNotGranted, perm->grant != permNotGranted);
|
pMgr->load_permission(perm->permission->type, {perm->value, perm->grant}, channel->channelId(), perm->flag_skip, perm->flag_negate, perm->value != permNotGranted, perm->grant != permNotGranted);
|
||||||
else
|
else
|
||||||
pMgr->load_permission(perm->permission->type, {perm->value, perm->grant}, perm->flag_negate, perm->flag_skip, perm->value != permNotGranted, perm->grant != permNotGranted);
|
pMgr->load_permission(perm->permission->type, {perm->value, perm->grant}, perm->flag_skip, perm->flag_negate, perm->value != permNotGranted, perm->grant != permNotGranted);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
loaded = true;
|
loaded = true;
|
||||||
@ -423,7 +423,7 @@ std::shared_ptr<permission::v2::PermissionManager> DatabaseHelper::loadGroupPerm
|
|||||||
if(entry) {
|
if(entry) {
|
||||||
for(const auto& perm : entry->permissions) {
|
for(const auto& perm : entry->permissions) {
|
||||||
if(perm->type == permission::SQL_PERM_GROUP && perm->id == group_id) {
|
if(perm->type == permission::SQL_PERM_GROUP && perm->id == group_id) {
|
||||||
result->load_permission(perm->permission->type, {perm->value, perm->grant}, perm->flag_negate, perm->flag_skip, perm->value != permNotGranted, perm->grant != permNotGranted);
|
result->load_permission(perm->permission->type, {perm->value, perm->grant}, perm->flag_skip, perm->flag_negate, perm->value != permNotGranted, perm->grant != permNotGranted);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
@ -568,7 +568,7 @@ std::shared_ptr<permission::v2::PermissionManager> DatabaseHelper::loadChannelPe
|
|||||||
if(entry) {
|
if(entry) {
|
||||||
for(const auto& perm : entry->permissions) {
|
for(const auto& perm : entry->permissions) {
|
||||||
if(perm->type == permission::SQL_PERM_CHANNEL && perm->channelId == channel) {
|
if(perm->type == permission::SQL_PERM_CHANNEL && perm->channelId == channel) {
|
||||||
result->load_permission(perm->permission->type, {perm->value, perm->grant}, perm->flag_negate, perm->flag_skip, perm->value != permNotGranted, perm->grant != permNotGranted);
|
result->load_permission(perm->permission->type, {perm->value, perm->grant}, perm->flag_skip, perm->flag_negate, perm->value != permNotGranted, perm->grant != permNotGranted);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
|
Loading…
Reference in New Issue
Block a user