java - Liferay - Set guest permission on custom field/expandocolumn -
i've added custom field user sign-up page (create_account.jsp) creating expando column via hook plugin. however, field not visible until enable guest permissions on through admin ui.
i need able programmatically, through hook plugin. exhaustive research leads me believe following code should trick:
role guest = rolelocalserviceutil.getrole(companyid, roleconstants.guest); resourcepermissionlocalserviceutil.setresourcepermissions( companyid, expandocolumn.class.getname(), resourceconstants.scope_individual, string.valueof(expandocolumn.getcolumnid()), guest.getroleid(), new string[] { actionkeys.view, actionkeys.update });
but doesn't.
anyone got ideas?
i tried same code yours , worked me. in opinion problem in "expandocolumn.getcolumnid()". how retreive object expandocolumn? tried with table id , name:
expandocolumn expandocolumn = expandocolumnlocalserviceutil.getcolumn(21806, "menu");
for try retreive table id directly database, table "expandocolumn"
Comments
Post a Comment