Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document that GroupId attribute cannot override parent Group in UserPrivileges:LocalGroupMember #25

Open
garymazz opened this issue Apr 15, 2016 · 7 comments
Labels

Comments

@garymazz
Copy link

garymazz commented Apr 15, 2016

Hi,

I received an error "The UserPrivileges:LocalGroupMember element contains an unexpected attribute 'GroupId'."

From the doc it appears GroupId attribute is valid.

Can you tell me what I'm doing wrong ?

          <UserPrivileges:LocalGroupMember 
            Id="assign.SYS.ADMIN.GRP.USER" 
            UserId="USER" 
            GroupId="Administrators"
            AddOnInstall="yes" 
            RemoveOnUnInstall="yes" 
            CheckIfMember="yes" 
          />

@dblock dblock added the bug? label Apr 15, 2016
@dblock
Copy link
Owner

dblock commented Apr 15, 2016

That's strange, it's even used in demos, like here, maybe you can compare with that?

@garymazz
Copy link
Author

garymazz commented Apr 15, 2016

It is,, I lifted the code from your example.. :) I thought tags were evaluated individually.

BTW, where is you schema ?

Here is the component:

      <Component Id="create.ADMIN.GRP.USER" Guid="{Some_GUID}">
          <UserPrivileges:LocalUser 
            Id="ADMIN.USER" 
            Username="$(var.Admin.Name)" 
            Password="$(var.Admin.Password)" 
            CreateOnInstall="yes" 
            DeleteOnUnInstall="yes" 
            CheckIfExists="yes" 
          />
          <UserPrivileges:LocalGroup 
            Id="ADMIN.GRP" 
            Name="$(var.Admin.Group)" 
            Description="$(var.Admin.Group.Desc)" 
            CheckIfExists="yes" 
            CreateOnInstall="yes" 
            DeleteOnUnInstall="yes"
          >
            <UserPrivileges:LocalGroupMember 
              Id="assign.ADMIN.GRP.USER" 
              UserId="ADMIN.USER" 
              AddOnInstall="yes" 
              RemoveOnUnInstall="yes" 
              CheckIfMember="yes" 
            />
            <UserPrivileges:LocalGroupMember 
              Id="assign.SYS.ADMIN.GRP.USER" 
              UserId="ADMIN.USER" 
              GroupId="Administrators"
              AddOnInstall="yes" 
              RemoveOnUnInstall="yes" 
              CheckIfMember="yes" 
            />
            <UserPrivileges:LocalGroupMember 
              Id="remove.ADMIN.GRP.USER" 
              UserId="ADMIN.USER" 
              GroupId="Users"
              RemoveOnInstall="yes" 
              CheckIfMember="yes" 
           />
        </UserPrivileges:LocalGroup>
    </Component>

@garymazz
Copy link
Author

I did a bit more playing with the issue. It seems LocalGroupMember does not support a GroupId overide for when nested under local group. When I move the LocalGroupMember outside of LocalGroup nesting, the unexpected GroupId error is resolved; only to be replaced with another error..

You may consider "fixing" this with some documentation :) It's be easier for you than me (sorry)

@dblock
Copy link
Owner

dblock commented Apr 15, 2016

That makes sense! The schema is here.

@dblock dblock changed the title GroupId attribute unexpected in UserPrivileges:LocalGroupMember? Document that GroupId attribute cannot override parent Group in UserPrivileges:LocalGroupMember Apr 15, 2016
@dblock dblock added chore and removed bug? labels Apr 15, 2016
@dblock
Copy link
Owner

dblock commented Apr 15, 2016

Of course it'd be easier for me to do it @garymazz because you wouldn't have to do it :) It works both ways. Thanks for surfacing this either way.

@garymazz
Copy link
Author

Thanks for running with this. I'm very late on a deadline and need to fix issues in several open source projects, 4 alone with installation and a CI system. My issue is time, coming up to speed on all these OSS projects simultaneously.-, plus getting something to ship. After next friday, I'll have breathing room..

@garymazz
Copy link
Author

After going though UserPrivilegesCompiler.cs, I understood how UserId and GroupId worked. There is no overrides for GroupId when LocalGroupMember nested under LocalGroup. There is no override for UserId when nested under LocalUser. Both are just syntactic candy. I'll update the doc and add some comments to your examples as soon as I get the project building on VS 2015.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants