+1-888-365-2779
Try Now
More in this section

Forums / Security / PermissionSet control not visible

PermissionSet control not visible

2 posts, 0 answered
  1. Saumitra
    Saumitra avatar
    127 posts
    Registered:
    10 Mar 2009
    19 Aug 2010
    Link to this post
    Hi,

    I'm trying to implement security permissions in one of my intra-site modules. But the PermissionSet control that I'm using is not rendered by Siteifnity. Please refer the screenshots.

    Regards,
    Saumitra
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    19 Aug 2010
    Link to this post
    Hello Saumitra,

    Make sure that you have initialized the permisions in the code behind of your template

    protected override void InitializeControls()
      {
          base.InitializeControls();
          ApplicationPermission perm = GetPermission(CrudRights.ChangePermissions);
          PermissionSet1.Updating += PermissionSet1_Updating;
     
          PermissionSet1.Item = GetPermissions();
          PermissionSet1.Enabled = perm.CheckDemand();
      }
     
      /// <summary>
      /// Gets the permissions.
      /// </summary>
      /// <returns></returns>
      protected virtual ContactsPermissions GetPermissions()
      {
          return this.Host.Manager.Permissions;
      }
     
      /// <summary>
      /// Gets the permission.
      /// </summary>
      /// <returns></returns>
      protected virtual ApplicationPermission GetPermission()
      {
          return base.Host.Manager.GetPermission();
      }
     
      /// <summary>
      /// Gets the permission.
      /// </summary>
      /// <param name="requestRights">The request rights.</param>
      /// <returns></returns>
      protected virtual ApplicationPermission GetPermission(int requestRights)
      {
          return base.Host.Manager.GetPermission(requestRights);
      }
     
      #endregion
     
      #region Event handlers
     
      /// <summary>
      /// Handles the Updating event of the PermSet control.
      /// </summary>
      /// <param name="sender">The source of the event.</param>
      /// <param name="e">The <see cref="System.ComponentModel.CancelEventArgs"/> instance containing the event data.</param>
      protected void PermissionSet1_Updating(object sender, CancelEventArgs e)
      {
          ApplicationPermission perm = new ApplicationPermission(
              (ContactsPermissions)PermissionSet1.Item, CrudRights.ChangePermissions);
          perm.Demand();
      }
     
      #endregion


    Sincerely yours,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
2 posts, 0 answered