<span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px; border-collapse: collapse; color: rgb(34, 34, 34); ">HI there,<div><br></div><div>I was wondering if it's possible to add a new role to OpenCMS and use this role in a customized ToolHandler to set permissions.</div>
<div>A search in the mailing list archive gave me this posting: <a href="http://mail.opencms.org/pipermail/opencms-dev/2005q4/020289.html" target="_blank" style="color: rgb(53, 66, 88); ">http://mail.opencms.org/pipermail/opencms-dev/2005q4/020289.html</a></div>
<div><br></div><div><a href="http://mail.opencms.org/pipermail/opencms-dev/2005q4/020289.html" target="_blank" style="color: rgb(53, 66, 88); "></a>But where should I create the new CmsRole? It seems that it's not sufficient to create it in the custom ToolHandler.</div>
<div><br clear="all">"<span style="font-family: 'Times New Roman'; font-size: medium; "><span style="font-family: monospace; white-space: pre; ">but what is if no system role (defined in the org.opencms.security.CmsRole</span><pre style="white-space: pre-wrap; word-wrap: break-word; ">
class) fits your needs 100%?
Just create a new role, for instance:
-------------
public static final CmsRole SAMPLE = new CmsRole("SAMPLE", "Sample Group", new
CmsRole[] {CmsRole.ADMINISTRATOR});
-------------
Every direct or indirect member of the "Sample Group" group will have this role,
and also everybody having the ADMINISTRATOR role."</pre></span>Also, if I understand this correctly every user in the specified group gets the newly created custom role, but </div><div><br></div><div>public static final CmsRole NEW_ROLE= new CmsRole("NEW_ROLE", CmsRole.ADMINISTRATOR, "customgroup",false);</div>
<div><br></div><div><div>public boolean isVisible(CmsObject cms) {</div><div><br></div><div><span style="white-space: pre; "> </span>return OpenCms.getRoleManager().hasRole(cms, NEW_ROLE);</div><div><span style="white-space: pre; "> </span>}</div>
</div><div><br></div><div>returns false. Even if the specified user has the correct group. Any ideas?</div></span><br>-- <br>Mit freundlichen Grüßen / Best regards<br><br><br>Tobias Knierim<br>IT Consultant<br><br><br>-- <br>
<br>codecentric GmbH, Merscheider Str. 1, 42699 Solingen<br><br>Büro: +49 (0) 212 233628-69, Mobil: +49 (0) 170 9196589, Fax: +49 (0) 212 23362-79<br><br>Internet: <a href="http://www.codecentric.de">www.codecentric.de</a><br>
Blog: <a href="http://blog.codecentric.de">blog.codecentric.de</a><br><br>Geschäftsführer: Mirko Novakovic und Rainer Vehns<br>Sitz der Gesellschaft: Solingen<br>Registergericht: Amtsgericht Wuppertal, HRB 19214<br>
<br>Diese E-Mail einschließlich evtl. angehängter Dateien enthält vertrauliche und/oder rechtlich geschützte Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich erhalten haben, informieren Sie bitte sofort den Absender und löschen Sie diese E-Mail und evtl. anhängende Dateien umgehend. Das unerlaubte Kopieren, Nutzen oder Öffnen evtl. anhängender Dateien sowie die unbefugte Weitergabe dieser E-Mail ist nicht gestattet.<br>