[Zope-CMF] portal_membership.checkPermission('List portal members', member)
Florent Guillaume
fg@nuxeo.com
29 Nov 2001 13:31:15 GMT
checkPermission takes as parameters a permission and an object. You are
giving it a permission and a member object, which is not correct. Use:
portal_membership.checkPermission('xxx', member.getHomeFolder())
Florent
Antwan Reijnen <twanus@xs4all.nl> wrote:
> Hi all,
>
> I have a little problem, which I do not understand. I cannot find this in
> the archives, either (hope I searched well!). My Zope: 2.3.3, windows98.
>
> It is about the following code in the standard_top_bar:
>
> <dtml-let member="portal_membership.getAuthenticatedMember()"
> listMembers="portal_membership.checkPermission('List portal members',
> member)">
>
> I mapped the permission 'List portal members' to role Anonymous in the
> security tab of the cmf-site. So, the 'members' link in the top-bar should
> appear, no?
>
> But it does not. portal_membership.checkPermission('List portal members',
> member) evaluates to 0. I don't understand this, because:
>
> When I force this link on in the top-bar, and click on it (as anonymous
> user), I get the roster without problems.
>
> So, still trying, I turned this permission off again for anonymous user. The
> above expression still evaluates to 0, and clicking on 'members' as an
> anonymous user does'nt work anymore: a logon is forced. This is what I
> expect to happen.
>
> So: any ideas on this? Why does the checkPermission evaluate to zero,
> whereas it works correctly when displaying the member roster?
>
> Mmmm... Greetings, Antwan.
--
Florent Guillaume, Nuxeo SARL (Paris, France)
+33 1 40 33 79 10 http://nuxeo.com mailto:fg@nuxeo.com