permissions - Sitecore Active Directory 权限和角色中的角色问题

标签 permissions active-directory roles sitecore sitecore6

问题

我已经编写了自定义成员/角色/配置文件提供程序来针对 Active Directory 域对用户进行身份验证。我正在尝试使用角色中的角色为 ADDOMAIN 中的用户提供站点核心权限,方法是将他们的 AD 组添加为适当的站点核心角色的成员。如果我以 AD 用户身份登录,我似乎没有 sitecore 角色的权限,但是,如果我以同一 sitecore 角色的 sitecore 用户身份登录,我确实获得了权限。我需要在成员(member)/角色提供者中包含哪些东西才能使这项工作发挥作用,或者这里还有其他东西在起作用吗?

我们使用的是 Sitecore 6.4 版,如果这有什么不同的话。

解决方案 :@Yan 的回答完全解决了这个问题。问题是语言权限仅明确授予 sitecore 域用户(通过 sitecore\Everyone)。创建 AD 用户时,他们位于不同的域中并且不继承这些语言权限。解决方法是专门向 AD 域授予读/写权限,或者像我所做的那样,创建另一个站点核心角色并将必要的权限分配给该角色,然后将我的 AD 角色分配给该角色。

您需要在/System/Languages/[LANGUAGE: en in my case] 项的 master 数据库中设置 lang:read 和 lang:write 权限。如果您在安全编辑器中看不到这些权限,请单击列按钮并选择这些列。

更多细节

对于详细程度,我提前道歉。

我已经编写了自定义成员/角色/配置文件提供程序来针对 Active Directory 域对用户进行身份验证。我们没有使用 sitecore 提供的 AD 模块,因为我们只希望我们的用户看到特定的组和用户,而不是 AD 中的每个用户/组。我也只是尝试提供身份验证和角色成员资格服务,因为我不希望站点核心管理员能够修改 AD 用户或角色。

我正在测试的角色称为 sitecore\Content Author,因为它具有我希望我的 AD 用户拥有的权限。 AD 用户是 AD 和 sitecore 内的 ADDOMAIN\Web-Authors-Group 组的一部分,我已将此组设置为属于 sitecore\Content Author。用户 ADDOMAIN\sitecoreauthor1 是 AD 中 ADDOMAIN\Web-Authors-Group 的成员,我还有一个 sitecore 用户 sitecore\bcauthor 用户,他是 sitecore\Content Author 角色的成员。我还设置了一个单独的站点核心角色,称为 sitecore\SecondAuthorRole 和该角色中的用户 sitecore\secondAuthor 以测试角色中的角色功能是否正常工作。

万一这令人困惑,这是一个视觉表示:

Sitecore Roles

    sitecore\Content Author
      - sitecore\bcauthor
      - ADDOMAIN\Web-Authors-Group
      - sitecore\SecondAuthorRole
    sitecore\SecondAuthorRole
      - sitecore\secondAuthor

ActiveDirectory Groups

    ADDOMAIN\Web-Authors-Group
      - ADDOMAIN\sitecoreauthor1

If I log in as sitecore\bcauthor, I can do everything that the sitecore\Content Author role can do. If I log in as sitecore\secondAuthor, I can also do everything that the sitecore\Content Author role can do. However, if I log in as the ADDOMAIN\sitecoreauthor1 user, I don't seem to have any of the permissions of the sitecore\Content Author role.

Even more information

The permissions for the home item (which is the item I'm testing against) are:

 ar|sitecore\Content Author|pe|+item:rename|+item:write|+item:delete|+item:create|pd|+item:rename|+item:write|+item:delete|+item:create

代码

这是实现成员资格、角色和配置文件的只读提供程序的类的框架:

成员(member)提供者类
public class DirectoryMembershipProvider : System.Web.Security.MembershipProvider
{
    public override string ApplicationName { get; set; }
    public override bool EnablePasswordReset { get { return false; } }
    public override bool EnablePasswordRetrieval { get { return false; } }
    public override int MaxInvalidPasswordAttempts { get { return 100; } }
    public override int MinRequiredNonAlphanumericCharacters { get { return 0; } }
    public override int MinRequiredPasswordLength { get { return 1; } }
    public override MembershipPasswordFormat PasswordFormat { get { return MembershipPasswordFormat.Clear; } }
    public override string PasswordStrengthRegularExpression { get { return ""; } }
    public override bool RequiresQuestionAndAnswer { get { return false; } }
    public override bool RequiresUniqueEmail { get { return false; } }

    // Not implemented
    public override bool ChangePassword(string username, string oldPassword, string newPassword)
    public override bool ChangePasswordQuestionAndAnswer(string username, string password, string newPasswordQuestion, string newPasswordAnswer)
    public override MembershipUser CreateUser(string username, string password, string email, string passwordQuestion, string passwordAnswer, bool isApproved, object providerUserKey, out MembershipCreateStatus status)
    protected override byte[] DecryptPassword(byte[] encodedPassword)
    public override bool DeleteUser(string username, bool deleteAllRelatedData)
    protected override byte[] EncryptPassword(byte[] password)
    protected override byte[] EncryptPassword(byte[] password, MembershipPasswordCompatibilityMode legacyPasswordCompatibilityMode)
    protected override void OnValidatingPassword(ValidatePasswordEventArgs e)
    public override string ResetPassword(string username, string answer)
    public override bool UnlockUser(string userName)
    public override void UpdateUser(MembershipUser user)

    // Implemented functions
    public override MembershipUserCollection FindUsersByEmail(string emailToMatch, int pageIndex, int pageSize, out int totalRecords)
    public override MembershipUserCollection FindUsersByName(string usernameToMatch, int pageIndex, int pageSize, out int totalRecords)
    public override MembershipUserCollection GetAllUsers(int pageIndex, int pageSize, out int totalRecords)
    public override string GetPassword(string username, string answer)
    public override MembershipUser GetUser(object providerUserKey, bool userIsOnline)
    public override MembershipUser GetUser(string username, bool userIsOnline)
    public override string GetUserNameByEmail(string email)
    public override bool ValidateUser(string username, string password)
}

角色提供者
public class DirectoryRoleProvider : System.Web.Security.RoleProvider
{
    public override string ApplicationName { get; set; }

    // not implemented
    public override void AddUsersToRoles(string[] usernames, string[] roleNames)
    public override void CreateRole(string roleName)
    public override bool DeleteRole(string roleName, bool throwOnPopulatedRole)
    public override void RemoveUsersFromRoles(string[] usernames, string[] roleNames)

    // implemented functions
    public override string[] FindUsersInRole(string roleName, string usernameToMatch)
    public override string[] GetAllRoles()
    public override string[] GetRolesForUser(string username)
    public override string[] GetUsersInRole(string roleName)
    public override bool IsUserInRole(string username, string roleName)
    public override bool RoleExists(string roleName)
}

配置文件提供者
public class DirectoryProfileProvider : System.Web.Profile.ProfileProvider
{
    public override string ApplicationName { get; set; }

    public override int DeleteInactiveProfiles(ProfileAuthenticationOption authenticationOption, DateTime userInactiveSinceDate) { return 0; }
    public override int DeleteProfiles(ProfileInfoCollection profiles) { return 0; }
    public override int DeleteProfiles(string[] usernames) { return 0; }

    // not implemented
    public override ProfileInfoCollection FindInactiveProfilesByUserName(ProfileAuthenticationOption authenticationOption, string usernameToMatch, DateTime userInactiveSinceDate, int pageIndex, int pageSize, out int totalRecords)
    public override ProfileInfoCollection GetAllInactiveProfiles(ProfileAuthenticationOption authenticationOption, DateTime userInactiveSinceDate, int pageIndex, int pageSize, out int totalRecords)

    // implemented functions
    public override ProfileInfoCollection FindProfilesByUserName(ProfileAuthenticationOption authenticationOption, string usernameToMatch, int pageIndex, int pageSize, out int totalRecords)
    public override ProfileInfoCollection GetAllProfiles(ProfileAuthenticationOption authenticationOption, int pageIndex, int pageSize, out int totalRecords)
    public override int GetNumberOfInactiveProfiles(ProfileAuthenticationOption authenticationOption, DateTime userInactiveSinceDate)
    public override SettingsPropertyValueCollection GetPropertyValues(SettingsContext context, SettingsPropertyCollection collection)
    public override void SetPropertyValues(SettingsContext context, SettingsPropertyValueCollection collection)
}

最佳答案

老实说,我没有阅读整个文本,只是其中的“问题”部分。我怀疑我知道问题出在哪里。它与 Language:Read 和 Language:Write 权限有关。

看看我上一篇发给 this SDN forum thread 的帖子.请务必检查随附的带有图像的存档,以便更好地理解。

关于permissions - Sitecore Active Directory 权限和角色中的角色问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5495356/

相关文章:

linux权限组

ios - fork() 失败 (1 : Operation not permitted)

c# - 从网络外的本地计算机确定用户 Active Directory 组

c# - 如何使用 C#.Net 中的 LDAP 在 Windows 事件目录中获取组织单位的街道地址属性

asp.net-mvc - 允许多个角色访问 Controller 操作

c# - 在asp.net mvc中动态创建角色的优点是什么

spring - 如何在Spring Security 3中设置用户角色?

apache - Apache 可写目录权限的最佳实践是什么?

linux - 复制文件权限,但不复制文件

Powershell 主目录未在文件服务器文件系统上创建