フォーラム

ホーム » Liferay Portal » English » 3. Development

構造的に表示 平面上に表示 ツリー上に表示
スレッド [ 前へ | 次へ ]
toggle
David Calap
Expando Permission Exception
2012/07/19 0:32
答え

David Calap

ランク: New Member

投稿: 20

参加年月日: 2012/01/12

最近の投稿

Hi, I'm having a problem when I try to set an Attribute with a value in a specific Liferay user. The code that throws the exception...

1        if (!user.getExpandoBridge().hasAttribute(attr)) {
2            user.getExpandoBridge().addAttribute(attr, 15);
3        }
4        String nombreComu = GroupLocalServiceUtil.getGroup(groupId).getFriendlyURL();
5        landingUrl = "/group" + nombreComu + landingUrl;
6        user.getExpandoBridge().setAttribute(attr, landingUrl);


the weird thing is that in local is working correctly, but not in an external server with the same DB.

The exception is the next:

ERROR [ExpandoBridgeImpl:415] com.liferay.portal.security.auth.PrincipalException
com.liferay.portal.security.auth.PrincipalException
at com.liferay.portlet.expando.service.permission.ExpandoColumnPermissionImpl.check(ExpandoColumnPermissionImpl.java:35)
at com.liferay.portlet.expando.service.permission.ExpandoColumnPermissionUtil.check(ExpandoColumnPermissionUtil.java:32)
at com.liferay.portlet.expando.service.impl.ExpandoValueServiceImpl.addValue(ExpandoValueServiceImpl.java:47)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:112)
at com.liferay.portal.spring.transaction.TransactionInterceptor.invoke(TransactionInterceptor.java:71)
at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:108)
at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:59)
at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:108)
at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:59)
at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:108)
at com.liferay.portal.spring.aop.ServiceBeanAopProxy.invoke(ServiceBeanAopProxy.java:211)
at $Proxy144.addValue(Unknown Source)
at com.liferay.portlet.expando.service.ExpandoValueServiceUtil.addValue(ExpandoValueServiceUtil.java:46)
at com.liferay.portlet.expando.model.impl.ExpandoBridgeImpl.setAttribute(ExpandoBridgeImpl.java:402)
at com.liferay.portlet.expando.model.impl.ExpandoBridgeImpl.setAttribute(ExpandoBridgeImpl.java:391)
at com.vm.rehabilita.liferay.portlet.faces.bean.RegistroUsuariosBean.checkExistCustomAttribute(RegistroUsuariosBean.java:876)
at com.vm.rehabilita.liferay.portlet.faces.bean.RegistroUsuariosBean.addUser(RegistroUsuariosBean.java:791)
at com.vm.rehabilita.liferay.portlet.faces.bean.RegistroUsuariosBean.doCreateUser(RegistroUsuariosBean.java:643)
at com.vm.rehabilita.liferay.portlet.faces.bean.RegistroUsuariosBean.registrarUsuario(RegistroUsuariosBean.java:216)
at com.vm.rehabilita.liferay.portlet.faces.bean.RegistroUsuariosBean.submitAll(RegistroUsuariosBean.java:201)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.el.parser.AstValue.invoke(AstValue.java:262)
at org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:278)
at com.sun.faces.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:105)
at javax.faces.event.MethodExpressionActionListener.processAction(MethodExpressionActionListener.java:148)
at javax.faces.event.ActionEvent.processListener(ActionEvent.java:88)
at javax.faces.component.UIComponentBase.broadcast(UIComponentBase.java:769)
at javax.faces.component.UICommand.broadcast(UICommand.java:300)
at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:794)
at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1259)
at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:81)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
at com.liferay.faces.bridge.lifecycle.LifecycleWrapper.execute(LifecycleWrapper.java:35)
at com.liferay.faces.bridge.BridgePhaseActionImpl.execute(BridgePhaseActionImpl.java:87)
at com.liferay.faces.bridge.BridgeImpl.doFacesRequest(BridgeImpl.java:55)
at javax.portlet.faces.GenericFacesPortlet.doBridgeDispatch(GenericFacesPortlet.java:686)
at javax.portlet.faces.GenericFacesPortlet.doActionDispatchInternal(GenericFacesPortlet.java:621)
at javax.portlet.faces.GenericFacesPortlet.processAction(GenericFacesPortlet.java:281)
at com.liferay.portlet.FilterChainImpl.doFilter(FilterChainImpl.java:70)
at com.liferay.portal.kernel.portlet.PortletFilterUtil.doFilter(PortletFilterUtil.java:48)
at com.liferay.portal.kernel.servlet.PortletServlet.service(PortletServlet.java:93)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:72)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilter.doFilter(InvokerFilter.java:70)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:684)
at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:593)
at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:530)
at com.liferay.portlet.InvokerPortletImpl.invoke(InvokerPortletImpl.java:637)
at com.liferay.portlet.InvokerPortletImpl.invokeAction(InvokerPortletImpl.java:686)
at com.liferay.portlet.InvokerPortletImpl.processAction(InvokerPortletImpl.java:361)
at com.liferay.portal.action.LayoutAction.processPortletRequest(LayoutAction.java:845)
at com.liferay.portal.action.LayoutAction.processLayout(LayoutAction.java:633)
at com.liferay.portal.action.LayoutAction.execute(LayoutAction.java:244)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
at com.liferay.portal.struts.PortalRequestProcessor.process(PortalRequestProcessor.java:174)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:641)
at com.liferay.portal.servlet.MainServlet.callParentService(MainServlet.java:533)
at com.liferay.portal.servlet.MainServlet.service(MainServlet.java:510)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:72)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:113)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:113)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:113)
at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:121)
at com.liferay.portal.servlet.filters.secure.SecureFilter.processFilter(SecureFilter.java:201)
at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:48)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:203)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:105)
at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:121)
at com.liferay.portal.servlet.filters.autologin.AutoLoginFilter.processFilter(AutoLoginFilter.java:240)
at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:48)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:203)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:105)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilter.doFilter(InvokerFilter.java:70)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:684)
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:471)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:402)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:329)
at com.liferay.portal.servlet.FriendlyURLServlet.service(FriendlyURLServlet.java:135)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:72)
at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:121)
at com.liferay.portal.servlet.filters.strip.StripFilter.processFilter(StripFilter.java:304)
at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:48)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:203)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:105)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:113)
at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:121)
at com.liferay.portal.servlet.filters.gzip.GZipFilter.processFilter(GZipFilter.java:123)
at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:48)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:203)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:105)
at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:121)
at com.liferay.portal.servlet.filters.secure.SecureFilter.processFilter(SecureFilter.java:201)
at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:48)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:203)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:105)
at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:121)
at com.liferay.portal.servlet.filters.i18n.I18nFilter.processFilter(I18nFilter.java:241)
at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:48)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:203)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:105)
at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:121)
at com.liferay.portal.servlet.filters.etag.ETagFilter.processFilter(ETagFilter.java:55)
at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:48)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:203)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:105)
at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:121)
at com.liferay.portal.servlet.filters.autologin.AutoLoginFilter.processFilter(AutoLoginFilter.java:240)
at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:48)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:203)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:105)
at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:121)
at com.liferay.portal.servlet.filters.sso.ntlm.NtlmPostFilter.processFilter(NtlmPostFilter.java:83)
at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:48)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:203)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:105)
at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:121)
at com.liferay.portal.sharepoint.SharepointFilter.processFilter(SharepointFilter.java:80)
at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:48)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:203)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:105)
at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:121)
at com.liferay.portal.servlet.filters.virtualhost.VirtualHostFilter.processFilter(VirtualHostFilter.java:208)
at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:48)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:203)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:105)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDirectCallFilter(InvokerFilterChain.java:184)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:92)
at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:738)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:203)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:105)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDirectCallFilter(InvokerFilterChain.java:164)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:92)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDirectCallFilter(InvokerFilterChain.java:164)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:92)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDirectCallFilter(InvokerFilterChain.java:184)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:92)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilter.doFilter(InvokerFilter.java:70)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:928)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:987)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:539)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:298)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)


Any idea?

Regards.
Pinkesh Gandhi
RE: Expando Permission Exception
2012/07/19 0:47
答え

Pinkesh Gandhi

ランク: Regular Member

投稿: 100

参加年月日: 2012/01/26

最近の投稿

Are you trying to execute your application by normal user who don't have admin rights? If the logged in user is not an admin or don't have admin rights then this permission issue comes.

On other side, if you want to execute it by normal user also then you have to change the code and you have to use relevant local service utils to implement this functionality. You can use ExpandoTableLocalServiceUtil, ExpandoColumnLocalServiceUtil and ExpandoValueLocalServiceUtil.
David Calap
RE: Expando Permission Exception
2012/07/19 1:36
答え

David Calap

ランク: New Member

投稿: 20

参加年月日: 2012/01/12

最近の投稿

Yes, that's the problem, the user who calls that method is not the admin. I'll research what u said to fix it. Thanks Pinkesh Gandhi!
Tina Agrawal
RE: Expando Permission Exception
2012/07/19 5:33
答え

Tina Agrawal

ランク: Regular Member

投稿: 221

参加年月日: 2008/01/02

最近の投稿

Or the other way of doing it would be setting the permissions for the normal user to update and view that custom attribute.

Tina
David Calap
RE: Expando Permission Exception
2012/07/19 6:36
答え

David Calap

ランク: New Member

投稿: 20

参加年月日: 2012/01/12

最近の投稿

Thx u Tina, you know the quick way to do that? I mean, the LR Class and methods? Thx in advance
Tina Agrawal
RE: Expando Permission Exception
2012/07/19 8:31
答え

Tina Agrawal

ランク: Regular Member

投稿: 221

参加年月日: 2008/01/02

最近の投稿

Hi David,

The API to be called will be from class - ResourcePermissionServiceUtil

1public static void setIndividualResourcePermissions(long groupId,
2        long companyId, java.lang.String name, java.lang.String primKey,
3        long roleId, java.lang.String[] actionIds)


Where selResource will be - com.liferay.portlet.expando.model.ExpandoColumn
resourcePrimKey - Primrary key of the column
actionIds - List of permissions like VIEW, UPDATE

Regards,
Tina
Ilias Stergiou
RE: Expando Permission Exception
2012/07/26 1:33
答え

Ilias Stergiou

ランク: New Member

投稿: 2

参加年月日: 2012/03/01

最近の投稿

Hello Tina,
I also believe it is better to set the permissions to allow updates from normal users. In my case I need SITE_MEMBERS to update custom attributes in DLFileEntry. Your solution is better since it will allow me to update the custom values simply using:
fileEntry.getExpandoBridge().setAttribute("extReg","some value");
fileServiceWrapper.updateDLFileEntry(fileEntry);

I have tried to implement your proposal without success. I understand that you proposed the following:
 1public void setIndividualResourcePermissionOnExpandoColumn(long groupId, long companyId, String attr) {
 2    try {
 3        Role memberRole = RoleLocalServiceUtil.getRole(companyId, RoleConstants.SITE_MEMBER);
 4        String[] actionsRW = new String[] { ActionKeys.VIEW, ActionKeys.UPDATE };
 5        ExpandoBridge expandoBridge = ExpandoBridgeFactoryUtil.getExpandoBridge(
 6            companyId,
 7            DLFileEntry.class.getName());
 8        ExpandoColumn column = ExpandoColumnLocalServiceUtil.getColumn(
 9                   companyId,
10                   expandoBridge.getClassName(),
11                   ExpandoTableConstants.DEFAULT_TABLE_NAME,
12                   attr);
13        ResourcePermissionServiceUtil.setIndividualResourcePermissions(
14            groupId,
15            companyId,
16            ExpandoColumn.class.getName(),
17            String.valueOf(column.getColumnId()),
18            memberRole.getRoleId(),
19            actionsRW
20            );
21    } catch (Exception e) {
22        e.printStackTrace();
23    }
24}


where attr = "extReg"

Is that what you proposed?

Ilias
Florencia Gadea
RE: Expando Permission Exception
2013/04/22 5:49
答え

Florencia Gadea

ランク: Regular Member

投稿: 159

参加年月日: 2012/03/27

最近の投稿

Hi!

I have exactly the same problem. Ilias, did you ever find out how to solve it?

Regards,

Flor.
Ilias Stergiou
RE: Expando Permission Exception
2013/04/22 6:55
答え

Ilias Stergiou

ランク: New Member

投稿: 2

参加年月日: 2012/03/01

最近の投稿

Hello Florencia,
No, I had no success spending the time I could on this subject. I added in my administrator/installation procedures the "manual" way of allowing specific roles been able to update expando values of DLFileEntries, as follows: Control Panel > Custom Fields > Documents and Media Document > Edit > Actions > Permissions and set the permissions you need.
Regards,
Ilias
Florencia Gadea
RE: Expando Permission Exception
2013/04/22 8:33
答え

Florencia Gadea

ランク: Regular Member

投稿: 159

参加年月日: 2012/03/27

最近の投稿

Hi Ilias,

I managed to solve this programatically, with this code, when creating the expando table and column:

1
2ExpandoTable expandoTable = ExpandoTableLocalServiceUtil.addTable(companyId, User.class.getName(), ExpandoTableConstants.DEFAULT_TABLE_NAME);
3ExpandoColumn expandoColumn = ExpandoColumnLocalServiceUtil.addColumn(
4                    expandoTable.getTableId(), "fieldName",
5                    ExpandoColumnConstants.STRING);            
6Role user = RoleLocalServiceUtil.getRole(companyId, RoleConstants.USER);
7ResourcePermissionLocalServiceUtil.setResourcePermissions(companyId, ExpandoColumn.class.getName(), ResourceConstants.SCOPE_COMPANY,       
8                                        String.valueOf(expandoColumn.getColumnId()), user.getRoleId(), new String[] { ActionKeys.VIEW, ActionKeys.UPDATE });


I hope this helps you too.

Regards,

Flor.