Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
XWIKI-17533: Allow to set custom rights in administration (#1644)
* Provide a new API to retrieve all rights names in SecurityAuthorizationScriptService * Provide a new administration section to configure the custom rights * Edit rightsUI.vm to allow customize custom rights, without breaking the existing rights and UIs mechanisms
- Loading branch information
Showing
4 changed files
with
341 additions
and
10 deletions.
There are no files selected for viewing
301 changes: 301 additions & 0 deletions
301
...n/xwiki-platform-administration-ui/src/main/resources/XWiki/AdminExtensionRightsSheet.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,301 @@ | ||
<?xml version="1.1" encoding="UTF-8"?> | ||
|
||
<!-- | ||
* See the NOTICE file distributed with this work for additional | ||
* information regarding copyright ownership. | ||
* | ||
* This is free software; you can redistribute it and/or modify it | ||
* under the terms of the GNU Lesser General Public License as | ||
* published by the Free Software Foundation; either version 2.1 of | ||
* the License, or (at your option) any later version. | ||
* | ||
* This software is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
* Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public | ||
* License along with this software; if not, write to the Free | ||
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA | ||
* 02110-1301 USA, or see the FSF site: http://www.fsf.org. | ||
--> | ||
|
||
<xwikidoc version="1.4" reference="XWiki.AdminExtensionRightsSheet" locale=""> | ||
<web>XWiki</web> | ||
<name>AdminExtensionRightsSheet</name> | ||
<language/> | ||
<defaultLanguage/> | ||
<translation>0</translation> | ||
<creator>xwiki:XWiki.Admin</creator> | ||
<parent>Main.WebHome</parent> | ||
<author>xwiki:XWiki.Admin</author> | ||
<contentAuthor>xwiki:XWiki.Admin</contentAuthor> | ||
<version>1.1</version> | ||
<title>AdminExtensionRightsSheet</title> | ||
<comment/> | ||
<minorEdit>false</minorEdit> | ||
<syntaxId>xwiki/2.1</syntaxId> | ||
<hidden>true</hidden> | ||
<content>{{velocity}} | ||
### Sheet used to generically display the XWikiPreferences object fields in the administration sheets. | ||
{{html}} | ||
<form method="post" action="$xwiki.getURL($currentDoc, 'saveandcontinue')" class="xform"> | ||
############################################################################################ | ||
## RIGHTS | ||
############################################################################################ | ||
<fieldset> | ||
#template('rightsUI.vm') | ||
</fieldset> | ||
</form> | ||
{{/html}} | ||
{{/velocity}}</content> | ||
<object> | ||
<name>XWiki.AdminExtensionRightsSheet</name> | ||
<number>0</number> | ||
<className>XWiki.ConfigurableClass</className> | ||
<guid>bad3af00-4a01-48b8-94ca-2111b758d219</guid> | ||
<class> | ||
<name>XWiki.ConfigurableClass</name> | ||
<customClass/> | ||
<customMapping/> | ||
<defaultViewSheet/> | ||
<defaultEditSheet/> | ||
<defaultWeb/> | ||
<nameField/> | ||
<validationScript/> | ||
<categoryIcon> | ||
<customDisplay/> | ||
<disabled>0</disabled> | ||
<hint/> | ||
<name>categoryIcon</name> | ||
<number>11</number> | ||
<picker>0</picker> | ||
<prettyName>categoryIcon</prettyName> | ||
<size>30</size> | ||
<unmodifiable>0</unmodifiable> | ||
<validationMessage/> | ||
<validationRegExp/> | ||
<classType>com.xpn.xwiki.objects.classes.StringClass</classType> | ||
</categoryIcon> | ||
<codeToExecute> | ||
<contenttype>VelocityWiki</contenttype> | ||
<customDisplay/> | ||
<disabled>0</disabled> | ||
<editor>---</editor> | ||
<hint/> | ||
<name>codeToExecute</name> | ||
<number>7</number> | ||
<picker>0</picker> | ||
<prettyName>codeToExecute</prettyName> | ||
<rows>5</rows> | ||
<size>40</size> | ||
<unmodifiable>0</unmodifiable> | ||
<validationMessage/> | ||
<validationRegExp/> | ||
<classType>com.xpn.xwiki.objects.classes.TextAreaClass</classType> | ||
</codeToExecute> | ||
<configurationClass> | ||
<cache>0</cache> | ||
<classname/> | ||
<customDisplay/> | ||
<defaultValue/> | ||
<disabled>0</disabled> | ||
<displayType>input</displayType> | ||
<freeText/> | ||
<hint/> | ||
<idField/> | ||
<largeStorage>0</largeStorage> | ||
<multiSelect>0</multiSelect> | ||
<name>configurationClass</name> | ||
<number>3</number> | ||
<picker>1</picker> | ||
<prettyName>configurationClass</prettyName> | ||
<relationalStorage>0</relationalStorage> | ||
<separator> </separator> | ||
<separators/> | ||
<size>30</size> | ||
<sort>none</sort> | ||
<sql/> | ||
<unmodifiable>0</unmodifiable> | ||
<validationMessage/> | ||
<validationRegExp/> | ||
<valueField/> | ||
<classType>com.xpn.xwiki.objects.classes.PageClass</classType> | ||
</configurationClass> | ||
<configureGlobally> | ||
<customDisplay/> | ||
<defaultValue/> | ||
<disabled>0</disabled> | ||
<displayFormType>checkbox</displayFormType> | ||
<displayType/> | ||
<hint/> | ||
<name>configureGlobally</name> | ||
<number>4</number> | ||
<prettyName>configureGlobally</prettyName> | ||
<unmodifiable>0</unmodifiable> | ||
<validationMessage/> | ||
<validationRegExp/> | ||
<classType>com.xpn.xwiki.objects.classes.BooleanClass</classType> | ||
</configureGlobally> | ||
<displayBeforeCategory> | ||
<customDisplay/> | ||
<disabled>0</disabled> | ||
<hint/> | ||
<name>displayBeforeCategory</name> | ||
<number>10</number> | ||
<picker>0</picker> | ||
<prettyName>displayBeforeCategory</prettyName> | ||
<size>30</size> | ||
<unmodifiable>0</unmodifiable> | ||
<validationMessage/> | ||
<validationRegExp/> | ||
<classType>com.xpn.xwiki.objects.classes.StringClass</classType> | ||
</displayBeforeCategory> | ||
<displayInCategory> | ||
<customDisplay/> | ||
<disabled>0</disabled> | ||
<hint/> | ||
<name>displayInCategory</name> | ||
<number>9</number> | ||
<picker>0</picker> | ||
<prettyName>displayInCategory</prettyName> | ||
<size>30</size> | ||
<unmodifiable>0</unmodifiable> | ||
<validationMessage/> | ||
<validationRegExp/> | ||
<classType>com.xpn.xwiki.objects.classes.StringClass</classType> | ||
</displayInCategory> | ||
<displayInSection> | ||
<customDisplay/> | ||
<disabled>0</disabled> | ||
<hint/> | ||
<name>displayInSection</name> | ||
<number>1</number> | ||
<picker>0</picker> | ||
<prettyName>displayInSection</prettyName> | ||
<size>30</size> | ||
<unmodifiable>0</unmodifiable> | ||
<validationMessage/> | ||
<validationRegExp/> | ||
<classType>com.xpn.xwiki.objects.classes.StringClass</classType> | ||
</displayInSection> | ||
<heading> | ||
<customDisplay/> | ||
<disabled>0</disabled> | ||
<hint/> | ||
<name>heading</name> | ||
<number>2</number> | ||
<picker>0</picker> | ||
<prettyName>heading</prettyName> | ||
<size>30</size> | ||
<unmodifiable>0</unmodifiable> | ||
<validationMessage/> | ||
<validationRegExp/> | ||
<classType>com.xpn.xwiki.objects.classes.StringClass</classType> | ||
</heading> | ||
<iconAttachment> | ||
<customDisplay/> | ||
<disabled>0</disabled> | ||
<hint/> | ||
<name>iconAttachment</name> | ||
<number>8</number> | ||
<picker>0</picker> | ||
<prettyName>iconAttachment</prettyName> | ||
<size>30</size> | ||
<unmodifiable>0</unmodifiable> | ||
<validationMessage/> | ||
<validationRegExp/> | ||
<classType>com.xpn.xwiki.objects.classes.StringClass</classType> | ||
</iconAttachment> | ||
<linkPrefix> | ||
<customDisplay/> | ||
<disabled>0</disabled> | ||
<hint/> | ||
<name>linkPrefix</name> | ||
<number>5</number> | ||
<picker>0</picker> | ||
<prettyName>linkPrefix</prettyName> | ||
<size>30</size> | ||
<unmodifiable>0</unmodifiable> | ||
<validationMessage/> | ||
<validationRegExp/> | ||
<classType>com.xpn.xwiki.objects.classes.StringClass</classType> | ||
</linkPrefix> | ||
<propertiesToShow> | ||
<cache>0</cache> | ||
<customDisplay/> | ||
<defaultValue/> | ||
<disabled>0</disabled> | ||
<displayType>input</displayType> | ||
<freeText/> | ||
<hint/> | ||
<largeStorage>0</largeStorage> | ||
<multiSelect>1</multiSelect> | ||
<name>propertiesToShow</name> | ||
<number>6</number> | ||
<picker>0</picker> | ||
<prettyName>propertiesToShow</prettyName> | ||
<relationalStorage>1</relationalStorage> | ||
<separator> </separator> | ||
<separators> ,|</separators> | ||
<size>20</size> | ||
<sort>none</sort> | ||
<unmodifiable>0</unmodifiable> | ||
<validationMessage/> | ||
<validationRegExp/> | ||
<values/> | ||
<classType>com.xpn.xwiki.objects.classes.StaticListClass</classType> | ||
</propertiesToShow> | ||
<sectionOrder> | ||
<customDisplay/> | ||
<disabled>0</disabled> | ||
<hint/> | ||
<name>sectionOrder</name> | ||
<number>12</number> | ||
<numberType>integer</numberType> | ||
<prettyName>sectionOrder</prettyName> | ||
<size>30</size> | ||
<unmodifiable>0</unmodifiable> | ||
<validationMessage/> | ||
<validationRegExp/> | ||
<classType>com.xpn.xwiki.objects.classes.NumberClass</classType> | ||
</sectionOrder> | ||
</class> | ||
<property> | ||
<categoryIcon/> | ||
</property> | ||
<property> | ||
<codeToExecute>{{include reference="XWiki.AdminExtensionRightsSheet" /}}</codeToExecute> | ||
</property> | ||
<property> | ||
<configurationClass/> | ||
</property> | ||
<property> | ||
<configureGlobally>1</configureGlobally> | ||
</property> | ||
<property> | ||
<displayBeforeCategory/> | ||
</property> | ||
<property> | ||
<displayInCategory>usersgroups</displayInCategory> | ||
</property> | ||
<property> | ||
<displayInSection>usersgroups.extensionrights</displayInSection> | ||
</property> | ||
<property> | ||
<heading/> | ||
</property> | ||
<property> | ||
<iconAttachment/> | ||
</property> | ||
<property> | ||
<linkPrefix/> | ||
</property> | ||
<property> | ||
<propertiesToShow/> | ||
</property> | ||
<property> | ||
<sectionOrder>375</sectionOrder> | ||
</property> | ||
</object> | ||
</xwikidoc> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.