Quantcast
Channel: NetSqlAzMan - .NET SQL Authorization Manager
Viewing all articles
Browse latest Browse all 163

New Post: Get a operations for a role

$
0
0

Hi,

this should be help you:

 

using System.Linq;

using NetSqlAzMan;

using NetSqlAzMan.Interfaces;

 

namespace NetSqlAzManDemo

{

 classProgram 

{

 staticvoid Main(string[] args)

{

 string sqlConnectionString = "data source=(local);Initial Catalog=NetSqlAzManStorage;Integrated Security=SSPI";

using (IAzManStorage storage = newSqlAzManStorage(sqlConnectionString))

{

storage.OpenConnection();

IAzManStore store = storage.GetStore("My Store");

IAzManApplication application = store.GetApplication("My Application");

 

//1. to get a list of operations for a particular role

IAzManItem myParticularRole = application.GetItem("My Particular Role Name");

IAzManItem[] operations = (from min myParticularRole.GetMembers()

where m.ItemType ==ItemType.Operation

select m).ToArray();

 

//2. to get a list of roles with a certain word in the description

IAzManItem[] rolesWithDescription = (from tin application.GetItems(ItemType.Role)

where t.Description.Contains("foo")

select t).ToArray();

}

}

}

}

 

 

Andrea Ferendeles / NetSqlAzMan Project Coordinator 


Viewing all articles
Browse latest Browse all 163

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>