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

Popular posts from this blog

wordpress - (T_ENDFOREACH) php error -

Export Excel workseet into txt file using vba - (text and numbers with formulas) -

Using django-mptt to get only the categories that have items -