HomeActive Query BuilderSecurity integrated to active query builder

Security integrated to active query builder


Hi,

I have some roles for users. Based on a role, i need to display columns of a table. At design time, i can restrict columns with following lines of code:

MetadataObject mo = queryBuilder.MetadataContainer.FindObjectByFullName("Communication");
mo.LoadFields();
MetadataField mf = mo.Fields[7];
mo.Fields.Remove(mf);

But at later point of time, when a new role gets added, how can i restict attribute level permission? Please give some idea.

Regards,
Chandra
Chandra
September 27 2010, 06:18 AM
Dear Chandra,

Not sure if I understand you right, but you may re-load fields with the following code:

mo.Clear();
mo.LoadFields();

If it's not what you are looking for, please explain your problem in detail.
Sergey Smagin | email
55 mins since original post
Hi Sergey,

I want to fetch only columns in objects for which a role has permission.In other words, a user can see only columns of objects which his role has permission i.e. Column level security or Attribute based security. Is there a way to customize code to achieve this ?

Best regards,
Chandra
Chandra
2 hours, 48 mins since original post
Dear Chandra,

There are several ways to do that. One of them is already given by you. Another way is to make different XML files with metadata for different roles and load them on changing a role. See this article for details: http://www.activedbsoft.com/helpdesk/index.php?pg=kb.page&id=1
If this way doesn't suit your needs, you may review the Load Metadata demo project that illustrate the possible ways of loading metadata.
Sergey Smagin | email
1 day, 23 hours since original post
This topic is closed