Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
RE: Liferay 6.2 CE admin cannot access the dockbar or the control panel
Greetings,
I'm running Liferay 6.2 CE with Tomcat 8.0.20, on two different environments.
On one environment, the administration dockbar has recently ceased appearing on the top of my Liferay portal when logged as admin. Also, trying to access the Liferay control panel directly with the URL takes me to a "not found" page.
I wonder if it could be a user-administration problem, for a few reasons:
-
The "portal-normal.vm" Velocity file in my theme contains the portion of code which rules the inclusion of the dockbar:
<span>#</span><span>if</span><span> </span><span>(</span><span>$is_signed_in </span><span>&&</span><span> $permissionChecker</span><span>.</span><span>isOmniadmin</span><span>())</span><span> </span><span> #</span><span>dockbar</span><span>()</span><span> </span><span>#</span><span>end</span>
I found out that when logging as admin, both $permissionChecker.isOmniadmin() and $permissionChecker.isCompanyAdmin() return "false", which doesn't look normal to me (but maybe I'm wrong?).
- When the same portal code (theme and portlets) is deployed in the other environment, logging as admin brings me everything I expect ($permissionChecker.isOmniadmin() == true, dockbar, control panel...).
Deleting temp/ and work/ directories in the Tomcat tree was to no avail.
Please, is there a way to fix this? Any advice would be very welcome!
EDIT 2018/09/07: This is an updated version of a post I first
made in Stack Overflow. Sorry for cross-posting - these are my first
steps in the Liferay Community forums, I'll be more cautious from
now on.
https://stackoverflow.com/questions/52182493/liferay-6-2-ce-admin-cannot-access-the-dockbar-or-the-control-panel
Okay, so let's start over...
Do you have an omniadmin.users value in the portal-ext.properties in the broken environment? Do you have a value in the portal-ext.properties file of the working environment?
For each of the user ids that maybe you have, are they assigned to the default company id? If not, they cannot be an omniadmin.
For company admin, if the user is an omniadmin, they are automatically a companyadmin.
For a user to be a company admin, their company id must match and they must have the Administrator role that shares the same company id. So if you have, say, 5 companies, you have 5 different Administrator roles, one for each company, and the user with the right company id must have the administrator role for that company.
Deleting temp and work is not going to have an impact, you have a data issue.
Thank you for the comment.
Indeed, it was a data issue. By querying the Users_Roles tables
in the DB, I found out that for some unclear reason, the
"admin" user actually had only a "User" role,
missing the "Administrator" and "Power user" roles
that it should have had. Without any other "Administrator"
user account, I corrected that anomaly in an unrecommended way - by
inserting the missing roles into the Users_Roles table (with the
application server temporarily shut down, of course). So far,
everything seems to have gotten back to normal.
Please, is there a way to close a topic in the Liferay
Community forums?
Benoit Smith:...I corrected that anomaly in an unrecommended way - by inserting the missing roles into the Users_Roles table (with the application server temporarily shut down, of course). So far, everything seems to have gotten back to normal.
Indeed unrecommended. You should have just done that through the UI while being a (property-powered) Omni-Admin. That's the right way. Writing to the database means: Even if it works now, it might fall flat on its face later, e.g. during upgrade, in case something else is required (but currently not catastrophically missing)
Benoit Smith:...Please, is there a way to close a topic in the Liferay Community forums?
You posted your answer, and what was the cause of your issue. This is enough, and your question and situation might help others finding this post later.
Powered by Liferay™