[Zope] How to hide the copy, cut, paste, rename, and select all buttons

Josef Meile jmeile@hotmail.com
Thu, 4 Jul 2002 18:29:48 +0200


This is a multi-part message in MIME format.

------=_NextPart_000_0041_01C22388.C76E1540
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Hi,
I've a zclass wich inherits from ObjectManager. Inside this
class, I've more classes that are ObjectManagers as well.
 I'd like to prevent that the user import, export, delete, copy,
cut, paste, and rename the objects inside the parent class.
But I want to restore this permissions (except Import/Export)
in the subclases. I've already reached the first part (delete
objects and disabling Import/Export). I just do the following
in the constructor method:

<dtml-with "ParentClass.createInObjectManager(REQUEST['id'], REQUEST)">
  Disabling Delete, Import and Export
  <dtml-call "manage_permission('Delete objects')">
  <dtml-call "manage_permission('Import/Export objects')">
  <dtml-with "Subclass1.createInObjectManager('id1',REQUEST)">
    <dtml-call "manage_permission('Delete objects',['Manager'])">
  </dtml-with>
  <dtml-with "Subclass2.createInObjectManager('id2',REQUEST)">
    <dtml-call "manage_permission('Delete objects',['Manager'])">
  </dtml-with>
  <dtml-with "Subclass3.createInObjectManager('id3',REQUEST)">
    <dtml-call "manage_permission('Delete objects',['Manager'])">
  </dtml-with>



And the "delete" button isn't shown anymore. I tried to do
the same for cut, copy, paste, and rename, but I found that
I would have to disable the 'View management screens'
permission. It doesn't have any sense because I want that
the user view the manage interface for that object, but with
some restrictions.

How can I reach this?

Thanks in advanced,
Josef.

------=_NextPart_000_0041_01C22388.C76E1540
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2716.2200" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Hi,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>I've a&nbsp;zclass wich inherits from=20
ObjectManager. Inside this</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>class, I've more classes that are =
ObjectManagers as=20
well.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;I'd like to </FONT><FONT =
face=3DArial=20
size=3D2>prevent that the user&nbsp;import, export, delete, =
copy,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>c</FONT><FONT face=3DArial size=3D2>ut, =
paste,=20
</FONT><FONT face=3DArial size=3D2>and rename </FONT><FONT face=3DArial =
size=3D2>the=20
</FONT><FONT face=3DArial size=3D2>objects inside the parent =
class.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>But I want </FONT><FONT face=3DArial =
size=3D2>to=20
restore this permissions (except Import/Export)</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>in the subclases.</FONT><FONT =
face=3DArial size=3D2>=20
I've </FONT><FONT face=3DArial size=3D2>already </FONT><FONT =
face=3DArial=20
size=3D2>reached the first part (delete</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>objects and disabling Import/Export). I =
just do the=20
following</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>in the constructor =
method:<BR></FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&lt;dtml-with=20
"ParentClass.createInObjectManager(REQUEST['id'], =
REQUEST)"&gt;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp; Disabling Delete, Import and=20
Export</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp; &lt;dtml-call =
"manage_permission('Delete=20
objects')"&gt;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp; &lt;dtml-call=20
"manage_permission('Import/Export objects')"&gt;<BR>&nbsp; &lt;dtml-with =

"Subclass1.createInObjectManager('id1',REQUEST)"&gt;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&lt;dtml-call=20
"manage_permission('Delete=20
objects',['Manager'])"&gt;<BR>&nbsp;&nbsp;&lt;/dtml-with&gt;</FONT></DIV>=

<DIV><FONT face=3DArial size=3D2>&nbsp; &lt;dtml-with=20
"Subclass2.createInObjectManager('id2',REQUEST)"&gt;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&lt;dtml-call=20
"manage_permission('Delete=20
objects',['Manager'])"&gt;<BR>&nbsp;&nbsp;&lt;/dtml-with&gt;</FONT></DIV>=

<DIV><FONT face=3DArial size=3D2>&nbsp; &lt;dtml-with=20
"Subclass3.createInObjectManager('id3',REQUEST)"&gt;<BR>&nbsp;&nbsp;&nbsp=
;&nbsp;&lt;dtml-call=20
"manage_permission('Delete=20
objects',['Manager'])"&gt;<BR>&nbsp;&nbsp;&lt;/dtml-with&gt;</FONT></DIV>=

<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;</DIV>
<DIV><BR></FONT><FONT face=3DArial size=3D2>And the "delete" button =
isn't shown=20
anymore. I tried to do</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>the same for cut, copy,&nbsp;paste, and =

rename,&nbsp;but I found that</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>I would </FONT><FONT face=3DArial =
size=3D2>have to=20
disable the 'View management screens'</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>permission. </FONT><FONT face=3DArial =
size=3D2>It=20
doesn't&nbsp;have any sense&nbsp;because I want that</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>the user </FONT><FONT face=3DArial =
size=3D2>view=20
</FONT><FONT face=3DArial size=3D2>the </FONT><FONT face=3DArial =
size=3D2>manage=20
</FONT><FONT face=3DArial size=3D2>interface for that object, but =
with</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>some </FONT><FONT face=3DArial=20
size=3D2>restrictions.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>How can I reach this?<BR><BR>Thanks in=20
advanced,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Josef.</DIV></FONT></BODY></HTML>

------=_NextPart_000_0041_01C22388.C76E1540--