AnsweredAssumed Answered

Changing Rights via GEL

Question asked by splogad on May 16, 2013
Latest reply on May 20, 2013 by splogad
Hi,

I need to change the rights of a given user (edit permissions of a given project) in a given moment.
Thus in GEL process I xog-out the user information and I get the correct list of instance rights i select using XPATH the nodes I want to remove
Finally I create a new list of rights that are the ones I would like to save again (let say all excepts the one selected above).

I set then new InstanceRight node in User object and I Xog In. But I always receive the following message:
<?xml version="1.0" encoding="UTF-8"?>
<XOGOutput xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../xsd/status.xsd">
  <Object type="user"/>
  <Status elapsedTime="0.401 seconds" state="SUCCESS"/>
  <Statistics failureRecords="0" insertedRecords="0" totalNumberOfRecords="1" updatedRecords="1"/>
  <Records>
    <Record>
      <KeyInformation>
        <column name="ALL">ALL RECORDS</column>
      </KeyInformation>
      <ErrorInformation>
        <Severity>WARNING</Severity>
        <Description>New Users Password will be Defaulted to Value niku2000</Description>
      </ErrorInformation>
    </Record>
  </Records>
</XOGOutput>
Assuming a wired user has only the following instancerights
<?xml version="1.0" encoding="UTF-8"?>
<NikuDataBus xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../xsd/nikuxog_user.xsd">
  <Header action="write" externalSource="NIKU" objectType="user" version="13.1.0.0248"/>
  <Users>
    <User externalId=" " isLDAP="false" uiThemeDefaultPartitionCode=" " userLanguage="Italian" userLocale="it" userName="fmasse" userStatus="ACTIVE"
      userTimezone="Europe/Amsterdam" userType="INTERNAL">
      <PersonalInformation emailAddress="francesca.bazzoni@i-faber.com" firstName="Federica" homeUrl="npt.overview" lastName="Masse"/>
      <Resource resourceId="fmasse"/>
      <BusinessObjects/>
      <Company/>
      <General addedBy="apivirotto" addedDate="2012-07-13"/>
      <OBSAssocs complete="false">
        <OBSAssoc id="Departments" name="Departments" unitPath="/i-Faber"/>
        <OBSAssoc id="Locations" name="Locations" unitPath="/Milano"/>
        <OBSAssoc id="res_pool" name="i-Faber - Security OBS" unitPath="/Amministratore Delegato/Sales/PP"/>
      </OBSAssocs>
      <Groups>
        <Group id="baseUserGroup">
          <nls description="Všichni uživatelé jsou přidáni do této skupiny. Skupina poskytuje základní práva uživatele." languageCode="cs" name="Základní skupina pro přístup uživatele"/>
          <nls description="Alle brugere føjes til denne gruppe. Den giver grundlæggende rettigheder for en bruger" languageCode="da" name="Basisgruppe for brugeradgang"/>
          <nls description="Alle Benutzer werden zu dieser Gruppe hinzugefügt, um grundlegende Benutzerrechte zu erhalten" languageCode="de" name="Grundlegende Gruppe für Benutzerzugriff"/>
          <nls description="All users are added to this group, it provides the basic rights for a user" languageCode="en" name="Basic group for user access"/>
          <nls description="Todos los usuarios se agregan a este grupo, el cual proporciona los derechos básicos a un usuario." languageCode="es" name="Grupo básico para el acceso del usuario"/>
          <nls description="Kaikki käyttäjät lisätään tähän ryhmään, joka myöntää käyttäjälle perusoikeudet" languageCode="fi" name="Perusryhmä käyttäjien käyttöoikeuksia varten"/>
          <nls description="Tous les utilisateurs sont ajoutés à ce groupe, qui fournit les droits de base" languageCode="fr" name="Groupe de base pour l'accès utilisateur"/>
          <nls description="Ebbe a csoportba minden felhasználó bekerül, ez biztosítja a felhasználó alapjogait" languageCode="hu" name="Felhasználó-hozzáférési alapcsoport"/>
          <nls description="Tutti gli utenti vengono aggiunti a questo gruppo. Fornisce i diritti di base per l'utente" languageCode="it" name="Gruppo di base per l'accesso degli utenti"/>
          <nls description="すべてのユーザはこのグループに追加されます。ユーザには基本的な権限が付与されます" languageCode="ja" name="ユーザ アクセス用基本グループ"/>
          <nls description="Alle brugere føjes til denne gruppe. Den giver grundlæggende rettigheder for en bruger" languageCode="ko" name="Basisgruppe for brugeradgang"/>
          <nls description="Alle gebruikers worden toegevoegd aan deze groep, die de basisrechten voor een gebruiker levert" languageCode="nl" name="Basisgroep voor gebruikertoegang"/>
          <nls description="Alle brukere er lagt til i denne gruppen, den gir grunnleggende rettigheter for en bruker" languageCode="no" name="Grunnleggende gruppe for brukertilgang"/>
          <nls description="Do tej grupy są dodani wszyscy użytkownicy - zapewnia ona podstawowe prawa użytkownika" languageCode="pl" name="Podstawowa grupa dostępu użytkownika"/>
          <nls description="Todos os usuários são adicionados a este grupo, ele fornece os direitos básicos para um usuário" languageCode="pt" name="Grupo básico para acesso do usuário"/>
          <nls description="В эту группу добавляются все пользователи; она обеспечивает базовые права для пользователя" languageCode="ru" name="Базовая группа для пользовательского доступа"/>
          <nls description="Alla användare läggs till i den här gruppen, och den ger grundläggande rättigheter för en användare" languageCode="sv" name="Grundläggande grupp för användaråtkomst"/>
          <nls description="Tüm kullanıcılar bu gruba eklendi; bir kullanıcının temel haklarını belirtir" languageCode="tr" name="Kullanıcı erişimi için temel grup"/>
          <nls description="Alle brugere føjes til denne gruppe. Den giver grundlæggende rettigheder for en bruger" languageCode="zh" name="Basisgruppe for brugeradgang"/>
          <nls description="Alle brugere føjes til denne gruppe. Den giver grundlæggende rettigheder for en bruger" languageCode="zh_TW" name="Basisgruppe for brugeradgang"/>
        </Group>
        <Group id="if_ppg">
          <nls description="Purcharing Partner group" languageCode="cs" name="Purcharing Partner"/>
          <nls description="Purcharing Partner group" languageCode="da" name="Purcharing Partner"/>
          <nls description="Purcharing Partner group" languageCode="de" name="Purcharing Partner"/>
          <nls description="Workflow group: Purcharing Partner  PR group" languageCode="en" name="Purchasing Partner PR"/>
          <nls description="Purcharing Partner group" languageCode="es" name="Purcharing Partner"/>
          <nls description="Purcharing Partner group" languageCode="fi" name="Purcharing Partner"/>
          <nls description="Purcharing Partner group" languageCode="fr" name="Purcharing Partner"/>
          <nls description="Purcharing Partner group" languageCode="hu" name="Purcharing Partner"/>
          <nls description="Purcharing Partner group" languageCode="it" name="Purcharing Partner"/>
          <nls description="Purcharing Partner group" languageCode="ja" name="Purcharing Partner"/>
          <nls description="Purcharing Partner group" languageCode="ko" name="Purcharing Partner"/>
          <nls description="Purcharing Partner group" languageCode="nl" name="Purcharing Partner"/>
          <nls description="Purcharing Partner group" languageCode="no" name="Purcharing Partner"/>
          <nls description="Purcharing Partner group" languageCode="pl" name="Purcharing Partner"/>
          <nls description="Purcharing Partner group" languageCode="pt" name="Purcharing Partner"/>
          <nls description="Purcharing Partner group" languageCode="ru" name="Purcharing Partner"/>
          <nls description="Purcharing Partner group" languageCode="sv" name="Purcharing Partner"/>
          <nls description="Purcharing Partner group" languageCode="tr" name="Purcharing Partner"/>
          <nls description="Purcharing Partner group" languageCode="zh" name="Purcharing Partner"/>
          <nls description="Purcharing Partner group" languageCode="zh_TW" name="Purcharing Partner"/>
        </Group>
        <Group id="if_sales_pr_h">
          <nls languageCode="cs" name="Sales Hunting"/>
          <nls languageCode="da" name="Sales Hunting"/>
          <nls languageCode="de" name="Sales Hunting"/>
          <nls languageCode="en" name="Sales Hunting"/>
          <nls languageCode="es" name="Sales Hunting"/>
          <nls languageCode="fi" name="Sales Hunting"/>
          <nls languageCode="fr" name="Sales Hunting"/>
          <nls languageCode="hu" name="Sales Hunting"/>
          <nls languageCode="it" name="Sales Hunting"/>
          <nls languageCode="ja" name="Sales Hunting"/>
          <nls languageCode="ko" name="Sales Hunting"/>
          <nls languageCode="nl" name="Sales Hunting"/>
          <nls languageCode="no" name="Sales Hunting"/>
          <nls languageCode="pl" name="Sales Hunting"/>
          <nls languageCode="pt" name="Sales Hunting"/>
          <nls languageCode="ru" name="Sales Hunting"/>
          <nls languageCode="sv" name="Sales Hunting"/>
          <nls languageCode="tr" name="Sales Hunting"/>
          <nls languageCode="zh" name="Sales Hunting"/>
          <nls languageCode="zh_TW" name="Sales Hunting"/>
        </Group>
      </Groups>
      <GlobalRights/>
      <InstanceRights>
        <Right id="ProjectApprove">
          <InstanceObject id="00000651_t" name="GA_1803_TR02-OPP1" type="SRM_PROJECTS"/>
        </Right>
        <Right id="ProjectBenefitPlanEdit">
          <InstanceObject id="00000651_t" name="GA_1803_TR02-OPP1" type="SRM_PROJECTS"/>
        </Right>
        <Right id="ProjectCostPlanEdit">
          <InstanceObject id="00000651_t" name="GA_1803_TR02-OPP1" type="SRM_PROJECTS"/>
        </Right>
        <Right id="ProjectEditFull">
          <InstanceObject id="00000651_t" name="GA_1803_TR02-OPP1" type="SRM_PROJECTS"/>
        </Right>
      </InstanceRights>
      <InstanceOBSRights/>
    </User>
  </Users>
  <XOGOutput>
    <Object type="user"/>
    <Status state="SUCCESS"/>
    <Statistics failureRecords="0" insertedRecords="0" totalNumberOfRecords="1" updatedRecords="0"/>
    <Records/>
  </XOGOutput>
</NikuDataBus>
After running this:
 <NikuDataBus xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../xsd/nikuxog_user.xsd"> 
 <Header action="write" externalSource="NIKU" objectType="user" version="13.0.0.7032"/> 

<Users> 


<User externalId=" " userName="fmasse"> 



<PersonalInformation emailAddress="francesca.bazzoni@i-faber.com" firstName="Federica" lastName="Masse"/>



<InstanceRights complete="true"> 




<Right id="ProjectApprove"> 





<InstanceObject id="00000651_t" name="GA_1803_TR02-OPP1" type="SRM_PROJECTS"/> 




</Right> 




<Right id="ProjectBenefitPlanEdit"> 





<InstanceObject id="00000651_t" name="GA_1803_TR02-OPP1" type="SRM_PROJECTS"/> 




</Right> 




<Right id="ProjectCostPlanEdit"> 





<InstanceObject id="00000651_t" name="GA_1803_TR02-OPP1" type="SRM_PROJECTS"/> 




</Right> 




<Right id="ProjectEditFull"> 





<InstanceObject id="00000651_t" name="GA_1803_TR02-OPP1" type="SRM_PROJECTS"/> 




</Right> 



</InstanceRights> 


</User> 

</Users> 
 </NikuDataBus>
The rights remain and new password warnging comes out.

Attached you find the scripts is

Attachments

Outcomes