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

[Reg cert] Admin should have permissions to manage certificates for an org #6071

Closed
anangaur opened this issue Jun 15, 2018 · 5 comments
Closed
Assignees

Comments

@anangaur
Copy link
Member

Admins should have all the permissions for an org. Currently an admin does not have perm to manage an org's certificates.

@skofman1 skofman1 changed the title [Reg cert] Amin should have permissions to manage certificates for an org [Reg cert] Admin should have permissions to manage certificates for an org Jun 20, 2018
@skofman1 skofman1 added this to the S137 - 2018.06.11 milestone Jun 21, 2018
@xavierdecoster
Copy link
Member

@anangaur @skofman1 are you referring to site admins that should have permission to manage certificates for an org? Org admins should already have that permission.

Should site admins have permission to manage an account? Or only certificates?
In code, there's currently no distinction between these.

Depending on the answer to the above question, the solution will be different.

Code path that checks for permissions to manage certificates:

private bool CanManageCertificates(User currentUser, User account)
{
  var wasAADLoginOrMultiFactorAuthenticated = User.WasMultiFactorAuthenticated() || User.WasAzureActiveDirectoryAccountUsedForSignin();
  return wasAADLoginOrMultiFactorAuthenticated
    && ActionsRequiringPermissions.ManageAccount.CheckPermissions(currentUser, account) == PermissionsCheckResult.Allowed;
}

Current permissions requirement for ManageAccount:

/// <summary>
/// The action of managing a user or organization account. This includes confirming an account,
/// changing the email address, changing email subscriptions, modifying sign-in credentials, etc.
/// </summary>
public static ActionRequiringAccountPermissions ManageAccount =
    new ActionRequiringAccountPermissions(
        accountPermissionsRequirement: RequireOwnerOrOrganizationAdmin);

Proposed change, if site admins should have permission to manage an account:

/// <summary>
/// The action of managing a user or organization account. This includes confirming an account,
/// changing the email address, changing email subscriptions, modifying sign-in credentials, etc.
/// </summary>
public static ActionRequiringAccountPermissions ManageAccount =
    new ActionRequiringAccountPermissions(
        accountPermissionsRequirement: RequireOwnerOrSiteAdminOrOrganizationAdmin);

Proposed change if site admins should only have permission to manage an account's certificates:

private bool CanManageCertificates(User currentUser, User account)
{
  var wasAADLoginOrMultiFactorAuthenticated = User.WasMultiFactorAuthenticated() || User.WasAzureActiveDirectoryAccountUsedForSignin();
  return wasAADLoginOrMultiFactorAuthenticated
    && (currentUser.IsAdministrator || ActionsRequiringPermissions.ManageAccount.CheckPermissions(currentUser, account) == PermissionsCheckResult.Allowed);
}

@anangaur
Copy link
Member Author

anangaur commented Aug 7, 2018

account would be better. I thought site admins could already manage the members of the org but not certs.

@scottbommarito
Copy link
Contributor

Upon discussion with @joelverhagen @anangaur @chenriksson - this should no longer be needed. The driving force between this feature has been resolved by #6150.

@xavierdecoster
Copy link
Member

@joelverhagen @scottbommarito does that mean this issue can be closed? :)

@anangaur
Copy link
Member Author

anangaur commented Aug 8, 2018

Not required, for now.

@anangaur anangaur closed this as completed Aug 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants