<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html; charset=ISO-8859-1"
 http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
I forgot to reply to the list<br>
<br>
-------- Originele bericht --------
<table class="moz-email-headers-table" border="0" cellpadding="0"
 cellspacing="0">
  <tbody>
    <tr>
      <th valign="BASELINE" align="RIGHT" nowrap="nowrap">Onderwerp: </th>
      <td>Re: [Grok-dev] Security declarations</td>
    </tr>
    <tr>
      <th valign="BASELINE" align="RIGHT" nowrap="nowrap">Datum: </th>
      <td>Fri, 09 Oct 2009 16:59:28 +0200</td>
    </tr>
    <tr>
      <th valign="BASELINE" align="RIGHT" nowrap="nowrap">Van: </th>
      <td>Marc Rijken <a class="moz-txt-link-rfc2396E" href="mailto:marc@rijken.org">&lt;marc@rijken.org&gt;</a></td>
    </tr>
    <tr>
      <th valign="BASELINE" align="RIGHT" nowrap="nowrap">Aan: </th>
      <td>Martijn Faassen <a class="moz-txt-link-rfc2396E" href="mailto:faassen@startifact.com">&lt;faassen@startifact.com&gt;</a></td>
    </tr>
  </tbody>
</table>
<br>
<br>
<meta content="text/html; charset=ISO-8859-1" http-equiv="Content-Type">
Hi Martijn,<br>
<br>
Thanx for your prompt reply. I have tried is in grok0.14. I did not get
any errors, but it did not work. When I changed the classes in to
strings it did work. I have moved the code to grok1.0 and it works as
expected. I'm not sure that was the only difference. <br>
<br>
BTW this behaviour is not document on
<a moz-do-not-send="true" class="moz-txt-link-freetext"
 href="http://grok.zope.org/doc/current/reference/directives.html#security-directives">http://grok.zope.org/doc/current/reference/directives.html#security-directives</a>
which states&nbsp; <cite>" permission</cite> &#8211; the name of the permission
that is required"<br>
<br>
Marc<br>
<br>
Op 9-10-2009 16:13, Martijn Faassen schreef:
<blockquote cite="mid:hangdq$uv4$1@ger.gmane.org" type="cite">
  <pre wrap="">Hey,

Marc Rijken wrote:
  </pre>
  <blockquote type="cite">
    <pre wrap="">In the security declarations we have to use the name of the permission. 
For me it is more logical and less error sensitive when the string may 
be replaced by the class.
    </pre>
  </blockquote>
  <pre wrap="">  </pre>
  <blockquote type="cite">
    <pre wrap="">My preferred situation is:

class FooPermssion(grok.Permission):
     grok.name('foo.permission')
     grok.title('Foo Permission')

class FooRole(grok.Role):
     grok.name('foo.Role')
     grok.title('Foo Role')
     grok.permissions(
         FooPermission,  # class instead of string
         )

class FooView(grok.View):
     grok.name('index.html')
     grok.require(FooPermission) # class instead of string

What do you think?
    </pre>
  </blockquote>
  <pre wrap="">Have you tried this? I thought we had this feature already, at least in 
grok.View. I'm not sure whether it also works for grok.Role. If not, 
that we should add this.

Regards,

Martijn

_______________________________________________
Grok-dev mailing list
<a moz-do-not-send="true" class="moz-txt-link-abbreviated"
 href="mailto:Grok-dev@zope.org">Grok-dev@zope.org</a>
<a moz-do-not-send="true" class="moz-txt-link-freetext"
 href="https://mail.zope.org/mailman/listinfo/grok-dev">https://mail.zope.org/mailman/listinfo/grok-dev</a>
  </pre>
</blockquote>
<br>
</body>
</html>