mirror of
https://github.com/Relintai/rcpp_framework.git
synced 2025-02-20 15:14:26 +01:00
Small comments for the future.
This commit is contained in:
parent
39f90bae9e
commit
5872d9d74f
@ -30,6 +30,8 @@ void RBACUserController::rbac_user_session_setup_middleware(Object *instance, Re
|
||||
}
|
||||
|
||||
void RBACUserController::rbac_default_user_session_middleware(Object *instance, Request *request) {
|
||||
//note: add a new file handler middleware func, so basic file handling is easy to set up before this
|
||||
|
||||
Ref<RBACRank> rank;
|
||||
|
||||
if (request->session) {
|
||||
@ -68,6 +70,9 @@ void RBACUserController::rbac_default_user_session_middleware(Object *instance,
|
||||
|
||||
if (!rank->has_permission(request, RBAC_PERMISSION_READ)) {
|
||||
if (rank->has_rank_permission(RBAC_RANK_PERMISSION_USE_REDIRECT)) {
|
||||
//Note this can make the webapp prone to enumerations, if not done correctly
|
||||
//e.g. redirect from /admin, but sending 404 on a non existing uri, which does not have
|
||||
//a special rbac entry
|
||||
request->send_redirect(RBACController::get_singleton()->get_redirect_url());
|
||||
return;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user