Re: [xwiki-users] problem with doc.display - trying to set permissions based on a group
A good way to have always up to date javadoc is by using http://nexus.xwiki.org/nexus/index.html#nexus-search. See http://platform.xwiki.org/xwiki/bin/view/DevGuide/API#HHowtofindaclass. On Mon, Aug 25, 2014 at 10:29 AM, Marius Dumitru Florea mariusdumitru.flo...@xwiki.com wrote: On Fri, Aug 22, 2014 at 2:16 PM, Dmitry Bakbardin haru_mamb...@mail.ru wrote: Hi! Marius, http://platform.xwiki.org/xwiki/bin/view/SRD/Navigation contains documentation up to 5.x. Where one can find 6.x documentation in the same way? Indeed, the SRD hasn't been updated in a while. There's a document explaining how to update it http://platform.xwiki.org/xwiki/bin/view/SRD/HowToBuild but I guess no one had the time to do it recently. In any case, most of the 5.x API should be present in 6.x. Thanks, Marius Fri, 22 Aug 2014 11:16:44 +0300 от Marius Dumitru Florea mariusdumitru.flo...@xwiki.com: On Wed, Aug 20, 2014 at 9:11 PM, Leonardo Kodato leonardokod...@gmail.com wrote: Hello everyone. I'm currently developing my skills with velocity to be able to make more advanced applications. Today what I'm trying to do is set some rights based on a modified version of FAQ Application. I've added just a Group field, so the user can direct his question to one of our departaments/groups. What I'm trying to accomplish is: A user creates a FAQ question, but only himself and a Group he chooses are able to view and edit the page. #set ($mydoc = $xwiki.getDocument(FAQ.$doc.name)) #set ($rightsObject = $mydoc.getObject(XWiki.XWikiRights, true)) #set ($result = $rightsObject.set(groups, $doc.display(group, view))) In http://platform.xwiki.org/xwiki/bin/view/DevGuide/ there is a link to Scripting Reference Documentation. Select $doc and look for getValue. Hope this helps, Marius #set ($result = $rightsObject.set(levels, edit)) #set ($result = $rightsObject.set(users, )) #set ($result = $rightsObject.set(allow, 1)) $mydoc.save() Problem: The object created with doc.display(group) gets the group with the all the wiki markup, when it should be getting only the text Sales. What I get: {{html clean=false wiki=false}} ul class=users... What I want: Sales I can easily set the user permission. The big problem is setting the group. Can you help me with this? Thanks. Att, Leonardo. ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users Kind regards, Dmitry ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users -- Thomas Mortagne ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users
Re: [xwiki-users] problem with doc.display - trying to set permissions based on a group
This is just a code to get the existing bindings and yes it does not replace the SRD. What we really need to automate the generation of the SRD but nobody had the time to work on it yet. Note that in that list you don't only have public APIs but also any velocity variable previously defined. Another probably more usefull list is the list of script services since I doubt there is any new standard binding since 5.x but there is new script services: {{velocity}} #foreach($service in $services.component.componentManager.getInstanceList('org.xwiki.script.service.ScriptService')) * **\$services.$$service** ($service.class) #end {{/velocity}} On Wed, Aug 27, 2014 at 1:41 PM, Dmitry Bakbardin haru_mamb...@mail.ru wrote: Thanks, Thomas! It works fine and gives me following (on 5.x) Some bindings I can guess and use in e.g. #if ($isSuperAdmin) ... #end. Excellent! What I was talking about is binding - Method Summary is missing in this case. It is extremely useful for me in http://platform.xwiki.org/xwiki/bin/view/SRD/Navigation?xpage=embed , but even with the guide I have no clue how to rebuild this for 6.x documentation, I'm not an Java developer :( $editorUrl (class java.lang.String) $hasWatch (class java.lang.String) $hasPreviousMenuSection (class java.lang.String) $isMainWikiUser (class java.lang.String) $spaceDeleteUrl (class java.lang.String) $displayLanguageChoice (class java.lang.String) $mainWikiHomeDocumentReference (class java.lang.String) $XWIKIVARS_VM (class java.lang.String) $hasCreatePage (class java.lang.String) $macro (class java.lang.String) $officeImporterMainDocument (class java.lang.String) $defaultStyleURL (class java.lang.String) $ooconfig (class java.lang.String) $spaceIndexUrl (class java.lang.String) $createWikiDocReference (class java.lang.String) $spaceHome (class java.lang.String) $template (class java.lang.String) $services (class java.lang.String) $parent (class java.lang.String) $isInPortletMode (class java.lang.String) $copyright (class java.lang.String) $searchDoc (class java.lang.String) $bodyTagName (class java.lang.String) $logoname (class java.lang.String) $displayHomeMenu (class java.lang.String) $isGuest (class java.lang.String) $displayContentMenu (class java.lang.String) $isAdminAppInstalled (class java.lang.String) $spaceAdminDocRef (class java.lang.String) $showhistory (class java.lang.String) $displayPageSubmenu (class java.lang.String) $watchClasses (class java.lang.String) $hasCreateWiki (class java.lang.String) $displayCreateSubmenu (class java.lang.String) $reservedSpaceName (class java.lang.String) $languageparams (class java.lang.String) $deleteUrl (class java.lang.String) $preferencesDoc (class java.lang.String) $xwiki (class java.lang.String) $discard (class java.lang.String) $stylesheets (class java.lang.String) $docvariant (class java.lang.String) $canShare (class java.lang.String) $logredir (class java.lang.String) $title (class java.lang.String) $hasDashboard (class java.lang.String) $spaceDoc (class java.lang.String) $hasSpaceAdmin (class java.lang.String) $isReadOnly (class java.lang.String) $keyboardShortcutsEnabled (class java.lang.String) $reservedDocumentReference (class java.lang.String) $officeimporter (class java.lang.String) $settingValue (class java.lang.String) $themeDocFullName (class java.lang.String) $backToEditAction (class java.lang.String) $cdoc (class java.lang.String) $displayCreateWiki (class java.lang.String) $syntaxFactory (class java.lang.String) $displayMainMenu (class java.lang.String) $theme (class java.lang.String) $spaceViewUrl (class java.lang.String) $hasCreateSpace (class java.lang.String) $gradientColorsToRemove (class java.lang.String) $logourl (class java.lang.String) $defaultstyle (class java.lang.String) $showattachments (class java.lang.String) $a11y (class java.lang.String) $searchSuggestConfigObject (class java.lang.String) $doc (class java.lang.String) $isWikiAPIAvailable (class java.lang.String) $crtUserDoc (class java.lang.String) $annotations (class java.lang.String) $showRightPanels (class java.lang.String) $xwikimode (class java.lang.String) $oomanager (class java.lang.String) $headertitle (class java.lang.String) $hasAdmin (class java.lang.String) $showannotations (class java.lang.String) $canDelete (class java.lang.String) $sectionNumber (class java.lang.String) $logouturl (class java.lang.String) $pdoc (class java.lang.String) $blacklistedSpaces (class java.lang.String) $skin (class java.lang.String) $colsclass (class java.lang.String) $canWatch (class java.lang.String) $isSuperAdmin (class java.lang.String) $level (class java.lang.String) $hasGlobalAdmin (class java.lang.String) $displayWikiSubmenu (class java.lang.String) $nstring (class java.lang.String) $linktextwords (class java.lang.String) $request (class java.lang.String) $tdoc (class java.lang.String) $viewUrl (class java.lang.String)
Re: [xwiki-users] problem with doc.display - trying to set permissions based on a group
Thanks, Thomas! This script doesn't work for me: it shows nothing. Tested at 5.x Also I'm issued http://jira.xwiki.org/browse/XWIKI-10851 for SRD update. Wed, 27 Aug 2014 14:15:56 +0200 от Thomas Mortagne thomas.morta...@xwiki.com: This is just a code to get the existing bindings and yes it does not replace the SRD. What we really need to automate the generation of the SRD but nobody had the time to work on it yet. Note that in that list you don't only have public APIs but also any velocity variable previously defined. Another probably more usefull list is the list of script services since I doubt there is any new standard binding since 5.x but there is new script services: {{velocity}} #foreach($service in $services.component.componentManager.getInstanceList('org.xwiki.script.service.ScriptService')) * **\$services.$$service** ($service.class) #end {{/velocity}} On Wed, Aug 27, 2014 at 1:41 PM, Dmitry Bakbardin haru_mamb...@mail.ru wrote: Thanks, Thomas! It works fine and gives me following (on 5.x) Some bindings I can guess and use in e.g. #if ($isSuperAdmin) ... #end. Excellent! What I was talking about is binding - Method Summary is missing in this case. It is extremely useful for me in http://platform.xwiki.org/xwiki/bin/view/SRD/Navigation?xpage=embed , but even with the guide I have no clue how to rebuild this for 6.x documentation, I'm not an Java developer :( $editorUrl (class java.lang.String) $hasWatch (class java.lang.String) $hasPreviousMenuSection (class java.lang.String) $isMainWikiUser (class java.lang.String) $spaceDeleteUrl (class java.lang.String) $displayLanguageChoice (class java.lang.String) $mainWikiHomeDocumentReference (class java.lang.String) $XWIKIVARS_VM (class java.lang.String) $hasCreatePage (class java.lang.String) $macro (class java.lang.String) $officeImporterMainDocument (class java.lang.String) $defaultStyleURL (class java.lang.String) $ooconfig (class java.lang.String) $spaceIndexUrl (class java.lang.String) $createWikiDocReference (class java.lang.String) $spaceHome (class java.lang.String) $template (class java.lang.String) $services (class java.lang.String) $parent (class java.lang.String) $isInPortletMode (class java.lang.String) $copyright (class java.lang.String) $searchDoc (class java.lang.String) $bodyTagName (class java.lang.String) $logoname (class java.lang.String) $displayHomeMenu (class java.lang.String) $isGuest (class java.lang.String) $displayContentMenu (class java.lang.String) $isAdminAppInstalled (class java.lang.String) $spaceAdminDocRef (class java.lang.String) $showhistory (class java.lang.String) $displayPageSubmenu (class java.lang.String) $watchClasses (class java.lang.String) $hasCreateWiki (class java.lang.String) $displayCreateSubmenu (class java.lang.String) $reservedSpaceName (class java.lang.String) $languageparams (class java.lang.String) $deleteUrl (class java.lang.String) $preferencesDoc (class java.lang.String) $xwiki (class java.lang.String) $discard (class java.lang.String) $stylesheets (class java.lang.String) $docvariant (class java.lang.String) $canShare (class java.lang.String) $logredir (class java.lang.String) $title (class java.lang.String) $hasDashboard (class java.lang.String) $spaceDoc (class java.lang.String) $hasSpaceAdmin (class java.lang.String) $isReadOnly (class java.lang.String) $keyboardShortcutsEnabled (class java.lang.String) $reservedDocumentReference (class java.lang.String) $officeimporter (class java.lang.String) $settingValue (class java.lang.String) $themeDocFullName (class java.lang.String) $backToEditAction (class java.lang.String) $cdoc (class java.lang.String) $displayCreateWiki (class java.lang.String) $syntaxFactory (class java.lang.String) $displayMainMenu (class java.lang.String) $theme (class java.lang.String) $spaceViewUrl (class java.lang.String) $hasCreateSpace (class java.lang.String) $gradientColorsToRemove (class java.lang.String) $logourl (class java.lang.String) $defaultstyle (class java.lang.String) $showattachments (class java.lang.String) $a11y (class java.lang.String) $searchSuggestConfigObject (class java.lang.String) $doc (class java.lang.String) $isWikiAPIAvailable (class java.lang.String) $crtUserDoc (class java.lang.String) $annotations (class java.lang.String) $showRightPanels (class java.lang.String) $xwikimode (class java.lang.String) $oomanager (class java.lang.String) $headertitle (class java.lang.String) $hasAdmin (class java.lang.String) $showannotations (class java.lang.String) $canDelete (class java.lang.String) $sectionNumber (class java.lang.String) $logouturl (class java.lang.String) $pdoc (class java.lang.String) $blacklistedSpaces (class java.lang.String) $skin (class java.lang.String) $colsclass (class java.lang.String) $canWatch (class java.lang.String) $isSuperAdmin (class java.lang.String) $level (class java.lang.String) $hasGlobalAdmin (class
Re: [xwiki-users] problem with doc.display - trying to set permissions based on a group
On Wed, Aug 27, 2014 at 2:56 PM, Dmitry Bakbardin haru_mamb...@mail.ru wrote: Thanks, Thomas! This script doesn't work for me: it shows nothing. Tested at 5.x Yes this script does not work in 5.x. What version are you on exatly ? Also I'm issued http://jira.xwiki.org/browse/XWIKI-10851 for SRD update. Wed, 27 Aug 2014 14:15:56 +0200 от Thomas Mortagne thomas.morta...@xwiki.com: This is just a code to get the existing bindings and yes it does not replace the SRD. What we really need to automate the generation of the SRD but nobody had the time to work on it yet. Note that in that list you don't only have public APIs but also any velocity variable previously defined. Another probably more usefull list is the list of script services since I doubt there is any new standard binding since 5.x but there is new script services: {{velocity}} #foreach($service in $services.component.componentManager.getInstanceList('org.xwiki.script.service.ScriptService')) * **\$services.$$service** ($service.class) #end {{/velocity}} On Wed, Aug 27, 2014 at 1:41 PM, Dmitry Bakbardin haru_mamb...@mail.ru wrote: Thanks, Thomas! It works fine and gives me following (on 5.x) Some bindings I can guess and use in e.g. #if ($isSuperAdmin) ... #end. Excellent! What I was talking about is binding - Method Summary is missing in this case. It is extremely useful for me in http://platform.xwiki.org/xwiki/bin/view/SRD/Navigation?xpage=embed , but even with the guide I have no clue how to rebuild this for 6.x documentation, I'm not an Java developer :( $editorUrl (class java.lang.String) $hasWatch (class java.lang.String) $hasPreviousMenuSection (class java.lang.String) $isMainWikiUser (class java.lang.String) $spaceDeleteUrl (class java.lang.String) $displayLanguageChoice (class java.lang.String) $mainWikiHomeDocumentReference (class java.lang.String) $XWIKIVARS_VM (class java.lang.String) $hasCreatePage (class java.lang.String) $macro (class java.lang.String) $officeImporterMainDocument (class java.lang.String) $defaultStyleURL (class java.lang.String) $ooconfig (class java.lang.String) $spaceIndexUrl (class java.lang.String) $createWikiDocReference (class java.lang.String) $spaceHome (class java.lang.String) $template (class java.lang.String) $services (class java.lang.String) $parent (class java.lang.String) $isInPortletMode (class java.lang.String) $copyright (class java.lang.String) $searchDoc (class java.lang.String) $bodyTagName (class java.lang.String) $logoname (class java.lang.String) $displayHomeMenu (class java.lang.String) $isGuest (class java.lang.String) $displayContentMenu (class java.lang.String) $isAdminAppInstalled (class java.lang.String) $spaceAdminDocRef (class java.lang.String) $showhistory (class java.lang.String) $displayPageSubmenu (class java.lang.String) $watchClasses (class java.lang.String) $hasCreateWiki (class java.lang.String) $displayCreateSubmenu (class java.lang.String) $reservedSpaceName (class java.lang.String) $languageparams (class java.lang.String) $deleteUrl (class java.lang.String) $preferencesDoc (class java.lang.String) $xwiki (class java.lang.String) $discard (class java.lang.String) $stylesheets (class java.lang.String) $docvariant (class java.lang.String) $canShare (class java.lang.String) $logredir (class java.lang.String) $title (class java.lang.String) $hasDashboard (class java.lang.String) $spaceDoc (class java.lang.String) $hasSpaceAdmin (class java.lang.String) $isReadOnly (class java.lang.String) $keyboardShortcutsEnabled (class java.lang.String) $reservedDocumentReference (class java.lang.String) $officeimporter (class java.lang.String) $settingValue (class java.lang.String) $themeDocFullName (class java.lang.String) $backToEditAction (class java.lang.String) $cdoc (class java.lang.String) $displayCreateWiki (class java.lang.String) $syntaxFactory (class java.lang.String) $displayMainMenu (class java.lang.String) $theme (class java.lang.String) $spaceViewUrl (class java.lang.String) $hasCreateSpace (class java.lang.String) $gradientColorsToRemove (class java.lang.String) $logourl (class java.lang.String) $defaultstyle (class java.lang.String) $showattachments (class java.lang.String) $a11y (class java.lang.String) $searchSuggestConfigObject (class java.lang.String) $doc (class java.lang.String) $isWikiAPIAvailable (class java.lang.String) $crtUserDoc (class java.lang.String) $annotations (class java.lang.String) $showRightPanels (class java.lang.String) $xwikimode (class java.lang.String) $oomanager (class java.lang.String) $headertitle (class java.lang.String) $hasAdmin (class java.lang.String) $showannotations (class java.lang.String) $canDelete (class java.lang.String) $sectionNumber (class java.lang.String) $logouturl (class java.lang.String) $pdoc (class java.lang.String) $blacklistedSpaces (class java.lang.String) $skin (class java.lang.String) $colsclass (class
Re: [xwiki-users] problem with doc.display - trying to set permissions based on a group
Hi everyone. I have followed your suggestion Marius and I'm beginning to understand how velocity works. It seems to be easy. But I cant make some things work: 1 - How can I get a object property when creating a document?I want to make the document only editable to its author and to a specified group of users(department - dept). The problem is that I can't get $doc.getAuthor before the document is created. The same happens with getValue(dept). #set ($object = $doc.getObject(XWiki.XWikiRights, true)) ## Deny the access to AllUsers #set($denyobject= $doc.newObject('XWiki.XWikiRights')) #set ($result = $denyobject.set(groups, Xwiki.AllUsers)) #set ($result = $denyobject.set(levels, view)) #set ($result = $denyobject.set(allow, false)) ##Allow the access to Document author and a selected group. ## Make the user's departament/group able to edit the page #set ($dept = $doc.getValue(dept)) #set($result2= $object.set(groups, Xwiki.$dept)) #set($result2= $object.set(levels, edit)) #set($result2= $object.set(allow, true)) ## Make the user himself able to edit the page #set($result3= $object.set(users, XWiki.$doc.getAuthor)) #set($result3= $object.set(levels, edit)) #set($result3= $object.set(allow, true)) Any ideas? Thank you. 2014-08-25 5:29 GMT-03:00 Marius Dumitru Florea mariusdumitru.flo...@xwiki.com: On Fri, Aug 22, 2014 at 2:16 PM, Dmitry Bakbardin haru_mamb...@mail.ru wrote: Hi! Marius, http://platform.xwiki.org/xwiki/bin/view/SRD/Navigation contains documentation up to 5.x. Where one can find 6.x documentation in the same way? Indeed, the SRD hasn't been updated in a while. There's a document explaining how to update it http://platform.xwiki.org/xwiki/bin/view/SRD/HowToBuild but I guess no one had the time to do it recently. In any case, most of the 5.x API should be present in 6.x. Thanks, Marius Fri, 22 Aug 2014 11:16:44 +0300 от Marius Dumitru Florea mariusdumitru.flo...@xwiki.com: On Wed, Aug 20, 2014 at 9:11 PM, Leonardo Kodato leonardokod...@gmail.com wrote: Hello everyone. I'm currently developing my skills with velocity to be able to make more advanced applications. Today what I'm trying to do is set some rights based on a modified version of FAQ Application. I've added just a Group field, so the user can direct his question to one of our departaments/groups. What I'm trying to accomplish is: A user creates a FAQ question, but only himself and a Group he chooses are able to view and edit the page. #set ($mydoc = $xwiki.getDocument(FAQ.$doc.name)) #set ($rightsObject = $mydoc.getObject(XWiki.XWikiRights, true)) #set ($result = $rightsObject.set(groups, $doc.display(group, view))) In http://platform.xwiki.org/xwiki/bin/view/DevGuide/ there is a link to Scripting Reference Documentation. Select $doc and look for getValue. Hope this helps, Marius #set ($result = $rightsObject.set(levels, edit)) #set ($result = $rightsObject.set(users, )) #set ($result = $rightsObject.set(allow, 1)) $mydoc.save() Problem: The object created with doc.display(group) gets the group with the all the wiki markup, when it should be getting only the text Sales. What I get: {{html clean=false wiki=false}} ul class=users... What I want: Sales I can easily set the user permission. The big problem is setting the group. Can you help me with this? Thanks. Att, Leonardo. ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users Kind regards, Dmitry ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users
Re: [xwiki-users] problem with doc.display - trying to set permissions based on a group
On Fri, Aug 22, 2014 at 2:16 PM, Dmitry Bakbardin haru_mamb...@mail.ru wrote: Hi! Marius, http://platform.xwiki.org/xwiki/bin/view/SRD/Navigation contains documentation up to 5.x. Where one can find 6.x documentation in the same way? Indeed, the SRD hasn't been updated in a while. There's a document explaining how to update it http://platform.xwiki.org/xwiki/bin/view/SRD/HowToBuild but I guess no one had the time to do it recently. In any case, most of the 5.x API should be present in 6.x. Thanks, Marius Fri, 22 Aug 2014 11:16:44 +0300 от Marius Dumitru Florea mariusdumitru.flo...@xwiki.com: On Wed, Aug 20, 2014 at 9:11 PM, Leonardo Kodato leonardokod...@gmail.com wrote: Hello everyone. I'm currently developing my skills with velocity to be able to make more advanced applications. Today what I'm trying to do is set some rights based on a modified version of FAQ Application. I've added just a Group field, so the user can direct his question to one of our departaments/groups. What I'm trying to accomplish is: A user creates a FAQ question, but only himself and a Group he chooses are able to view and edit the page. #set ($mydoc = $xwiki.getDocument(FAQ.$doc.name)) #set ($rightsObject = $mydoc.getObject(XWiki.XWikiRights, true)) #set ($result = $rightsObject.set(groups, $doc.display(group, view))) In http://platform.xwiki.org/xwiki/bin/view/DevGuide/ there is a link to Scripting Reference Documentation. Select $doc and look for getValue. Hope this helps, Marius #set ($result = $rightsObject.set(levels, edit)) #set ($result = $rightsObject.set(users, )) #set ($result = $rightsObject.set(allow, 1)) $mydoc.save() Problem: The object created with doc.display(group) gets the group with the all the wiki markup, when it should be getting only the text Sales. What I get: {{html clean=false wiki=false}} ul class=users... What I want: Sales I can easily set the user permission. The big problem is setting the group. Can you help me with this? Thanks. Att, Leonardo. ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users Kind regards, Dmitry ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users
Re: [xwiki-users] problem with doc.display - trying to set permissions based on a group
On Wed, Aug 20, 2014 at 9:11 PM, Leonardo Kodato leonardokod...@gmail.com wrote: Hello everyone. I'm currently developing my skills with velocity to be able to make more advanced applications. Today what I'm trying to do is set some rights based on a modified version of FAQ Application. I've added just a Group field, so the user can direct his question to one of our departaments/groups. What I'm trying to accomplish is: A user creates a FAQ question, but only himself and a Group he chooses are able to view and edit the page. #set ($mydoc = $xwiki.getDocument(FAQ.$doc.name)) #set ($rightsObject = $mydoc.getObject(XWiki.XWikiRights, true)) #set ($result = $rightsObject.set(groups, $doc.display(group, view))) In http://platform.xwiki.org/xwiki/bin/view/DevGuide/ there is a link to Scripting Reference Documentation. Select $doc and look for getValue. Hope this helps, Marius #set ($result = $rightsObject.set(levels, edit)) #set ($result = $rightsObject.set(users, )) #set ($result = $rightsObject.set(allow, 1)) $mydoc.save() Problem: The object created with doc.display(group) gets the group with the all the wiki markup, when it should be getting only the text Sales. What I get: {{html clean=false wiki=false}} ul class=users... What I want: Sales I can easily set the user permission. The big problem is setting the group. Can you help me with this? Thanks. Att, Leonardo. ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users
Re: [xwiki-users] problem with doc.display - trying to set permissions based on a group
Hi! Marius, http://platform.xwiki.org/xwiki/bin/view/SRD/Navigation contains documentation up to 5.x. Where one can find 6.x documentation in the same way? Fri, 22 Aug 2014 11:16:44 +0300 от Marius Dumitru Florea mariusdumitru.flo...@xwiki.com: On Wed, Aug 20, 2014 at 9:11 PM, Leonardo Kodato leonardokod...@gmail.com wrote: Hello everyone. I'm currently developing my skills with velocity to be able to make more advanced applications. Today what I'm trying to do is set some rights based on a modified version of FAQ Application. I've added just a Group field, so the user can direct his question to one of our departaments/groups. What I'm trying to accomplish is: A user creates a FAQ question, but only himself and a Group he chooses are able to view and edit the page. #set ($mydoc = $xwiki.getDocument(FAQ.$doc.name)) #set ($rightsObject = $mydoc.getObject(XWiki.XWikiRights, true)) #set ($result = $rightsObject.set(groups, $doc.display(group, view))) In http://platform.xwiki.org/xwiki/bin/view/DevGuide/ there is a link to Scripting Reference Documentation. Select $doc and look for getValue. Hope this helps, Marius #set ($result = $rightsObject.set(levels, edit)) #set ($result = $rightsObject.set(users, )) #set ($result = $rightsObject.set(allow, 1)) $mydoc.save() Problem: The object created with doc.display(group) gets the group with the all the wiki markup, when it should be getting only the text Sales. What I get: {{html clean=false wiki=false}} ul class=users... What I want: Sales I can easily set the user permission. The big problem is setting the group. Can you help me with this? Thanks. Att, Leonardo. ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users Kind regards, Dmitry ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users