Account Selector Field

  0 rating
3/22/2013 1:56:14 AM
4/17/2015 1:40:22 PM
Provider: Sitecore

About

The Account Selector Field module should help users to easily make lists of Sitecore Security Accounts, for which some custom logic may be applied. 

Documentation

Documentation
  • Documentation > Getting Started with the Account Selector Field
    Getting Started with the Account Selector Field

    1. Open the “Installation Wizard” application and upload the package into Sitecore:

    installation 1

    2. Proceed with the installation process:

    installation 2

     After installation finish open any item template and add to it new field – AccountSelector which is stored under the “Developer” field types group.
    After that define the AccountSelector field working options using the Field Source value and the following possible options:

    AllowMultipleSelection
      Allows to store several accounts within one field value and to select several users or roles within one dialog window.

    OnlyUsers
      Allows to select and add only users to the account list.

    OnlyRoles
      Allows to select and add only roles to the account list.

    UseExtraInformation
      Allows to store additional information about account types within field value.

    RolesInRoles
      Allows to select users that belong to groups that were not specified within the filter but they are children for the specified groups. ( i.e. use recursive search )

    <userfilter>domain\Role1|domain\Role2|...</userfilter>
      Allows to filter list of available for adding users by defined roles list.

    template account field

    After defining the field usage options navigate the ContentEditor to any sample item that uses the AccountSelector field.
    You will see the empty grey rectangle with the following text inside it:
    “Field value is empty. Click here to assign new value.”

    account field item

    Double click on this grey rectangle will bring up the dialog window that allows to easily manage the list of selected accounts (users or roles)
    account select dialog box

    After dialog window closing field value will be updated, and rectangle will contain the list of selected user.

    roles chosen

    Selected accounts are stored using the pipe-separated notation, you can check this using the Raw field values view of ContentEditor.
    roles and user

     By the way the AccountSelector field value can be easily managed by API using the following methods available in the installed CustomFields.AccountSelector.dll assembly:

    public class AccountSelectorField : CustomField
    {
        // Methods
        public AccountSelectorField(Field innerField);
        public void AddAccount(Account acc);
        private void AddSourceParameter(string param);
        public void ClearAccounts();
        public List<Account> GetAllSelectedAccounts();
        public List<Account> GetSelectedAccountsByType(AccountType accType);
        public static implicit operator AccountSelectorField(Field field);
        public void RemoveAccount(Account acc);
        private static string RemoveParameter(string originalValue, string param);
        private void RemoveSourceParameter(stringparam);
        public void SaveAccounts(List<Account> list);
        public void SetSourceParameter(string parameterName, bool value);
     
        //Properties
        public bool AllowFastSelection { get; set; }
        public bool AllowMultipleSelection { get; set; }
        public string FieldSource { get; set; }
        public string FieldValue { get; set; }
        public bool OnlyRoles { get; set; }
        public bool OnlyUsers { get; set; }
        public bool UseExtraInformation { get; set; }
    }



     



    0
Back
Release notes
The module was added 21-01-2010
Read more Back
Code examples

Solution screenshots(0)

Upload

Reviews (0)

Sort by: Date Most votes
  • Profile Avatar
    [fullName]

    Level: 0

    x0 x0 x0

    [date]

    [title]

    [text]

    Was this helpful?

    0

Comments (0)

Sort by: Date  Most votes

Leave a Comment

Comment must be field in
Post comment
loader

Write a review

Title can't be empty
Review can't be empty
Post review

Download

Title Description Download Action

Add File