{"record":{"id":"342823909e075f36","repo":"theonedev/onedev","slug":"you-are-not-allowed-to-perform-this-operation","errorCode":null,"errorMessage":"You are not allowed to perform this operation","messagePattern":"You are not allowed to perform this operation","errorType":"exception","errorClass":"UnauthorizedException","httpStatus":null,"severity":"error","filePath":"server-core/src/main/java/io/onedev/server/web/page/base/BasePage.java","lineNumber":530,"sourceCode":"\t\t\tthrow new RestartResponseAtInterceptPageException(ServerInitPage.class);\n\t}\n\n\tprotected boolean isPermitted() {\n\t\treturn true;\n\t}\n\n\tprotected String getRobotsMeta() {\n\t\treturn \"\";\n\t}\n\n\t@Nullable\n\tprotected final User getLoginUser() {\n\t\treturn SecurityUtils.getAuthUser();\n\t}\n\n\tpublic void unauthorized() {\n\t\tif (getLoginUser() != null)\n\t\t\tthrow new UnauthorizedException(\"You are not allowed to perform this operation\");\n\t\telse\n\t\t\tthrow new RestartResponseAtInterceptPageException(LoginPage.class);\n\t}\n\n\tprotected String getPageTitle() {\n\t\treturn \"OneDev - Git Server with CI/CD, Kanban, and Packages\";\n\t}\n\n\tprotected int getPageRefreshInterval() {\n\t\treturn 0;\n\t}\n\n\tprotected Collection<String> getCssClasses() {\n\t\tvar cssClasses = new HashSet<String>();\n\t\tif (WicketUtils.isSubscriptionActive())\n\t\t\tcssClasses.add(\"enterprise-edition\");\n\t\telse\n\t\t\tcssClasses.add(\"community-edition\");","sourceCodeStart":512,"sourceCodeEnd":548,"githubUrl":"https://github.com/theonedev/onedev/blob/d44925c47c37992c828ea673a5f9620539bc3ff2/server-core/src/main/java/io/onedev/server/web/page/base/BasePage.java#L512-L548","documentation":"BasePage.unauthorized() is called when page initialization determines the current user lacks required permissions. For logged-in users it throws UnauthorizedException with this message; anonymous users are redirected to the login page instead.","triggerScenarios":"Accessing a project/resource page whose authorization check (e.g. page's onInitialize access check) fails while a user is authenticated.","commonSituations":"User without required role (e.g. not project admin) opening an admin/configuration page; group/permission changes removed access; expired session falling back to a lower-privilege user.","solutions":["Ask a project/system administrator to grant the required permission.","Log in as a user with the needed role.","Verify group memberships and project authorizations in User/Group management."],"exampleFix":"// before: ordinary user opening /project/x/settings\n// after: grant 'Administer Project' or log in as an account with that role","handlingStrategy":"try-catch","validationCode":"// pre-check permission\nif (!SecurityUtils.canAccess(project, Permission.READ)) redirectToFallback();","typeGuard":null,"tryCatchPattern":"try {\n    visitPage();\n} catch (UnauthorizedException e) {\n    requestAccessOrSwitchAccount();\n}","preventionTips":["Confirm your role on the project before using admin pages.","Review group memberships after permission changes.","Use an account with the required privileges for administrative tasks."],"tags":["onedev","authorization","permissions"],"backgroundTag":"permission-denied","analyzedSha":"d44925c47c37992c828ea673a5f9620539bc3ff2","analyzedAt":"2026-09-06T07:18:27.995Z","contentChangedAt":"2026-09-06T07:18:27.995Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}