473,654 Members | 3,011 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Role based Security

Hi,

Regarding : Role based Security

Scenario :
On W2K, I'm currently logged in as 'user1'
Checking the properties of the user account 'user1' :
--> Start/Programs/Administrative Tools/Computer Management
In the 'Computer Management' app : opening System
Tools/Local users and Groups/Users
Tab: Member of
'Adminstrators'

Now, I have a test application (VB.NET) where I want to check what group the
currenty logged in user belongs to :
Private myWindowsPrinci pal As WindowsPrincipa l
Dim b As Boolean

myWindowsPrinci pal = New
WindowsPrincipa l(WindowsIdenti ty.GetCurrent() )
b = myWindowsPrinci pal.IsInRole(Wi ndowsBuiltInRol e.Administrator )
===> b is TRUE : OK

b = myWindowsPrinci pal.IsInRole(Wi ndowsBuiltInRol e.User)
===> b is TRUE ????
(b is always TRUE regardless of whether the current User actually
belongs to the 'Users' group or not)

I tried another syntax :
b = myWindowsPrinci pal.IsInRole("M YPC\Users") ' MYPC is
the computer name
===> b is always FALSE ???? regardless of whether the current
User actually belongs to the 'Users' group or not

I tried yet another syntax :
b = myWindowsPrinci pal.IsInRole("B UILTIN\Users")
===> b is always TRUE ???? regardless of whether the current
User actually belongs to the 'Users' group or not

Any ideas ?

Thanks


Jul 21 '05 #1
0 1306

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
2347
by: craig | last post by:
I am working on my first .NET development project that involves custom role-based security per the project requirements. This lead to a general design issue this week that really caused us some concern. I have described the situation below because we are very curious to see what other, more experienced, developers might suggest. The specific classes and fields are used just to illustrate the concepts. Our application uses role-based...
0
1374
by: ChrisB | last post by:
Hello: I am a member of a team creating a .NET application, and we seem to have run into an issue when trying to implement role based security. Our application makes use of a fairly common (table based) security model in which privileges are assigned to roles, which are then assigned users. So, for example, the user "JSmith" may be assigned to a "SalesRep" role and as a result have "Add Customer", "View Customer", and "Edit Customer"...
4
2924
by: hazz | last post by:
If I successfully run a VS.NET app which includes the following; ************************** APP 1 **************************** m_iIdnt = new System.Security.Principal.GenericIdentity(t.UserName,"MyAuthentication"); //user and My authentication type added to Identity string roles = {"Chief Cook and Bottle Washer", "Master Gardener"};
2
3042
by: Jesper Stocholm | last post by:
I have implemented role-based security within my ASP.Net application. However, it seems the role is not passed to the authentication ticket I create. I want to use it to display/hide some content based on the user's role. I wrote this to do it: if (HttpContext.Current.User.Identity.IsAuthenticated) { plLoggedIn.Visible = true;
0
1140
by: Liet Kynes | last post by:
I'm new to the .NET security framework, and I pose the following questions: 1) According to the documentation I've read .NET is promoting a role-based security model centered around IPrincipal. What about granular user-based security requirements? For example: I'm building a file repository app that allows users to upload files to the application and share them with specific users and groups/roles. Suppose we have three roles (officer,...
6
1473
by: Scott Natwick | last post by:
I would like to setup role-based security for my forms, however I'm having trouble working through an example I found. The example suggests creating a subdirectory for each role. I haven't been able to find a way to create pages in subdirectories in VS. Can this be done? Or can anyone suggest another example? Thanks in advance, Scott Natwick
3
2020
by: Mike Logan | last post by:
Questions about Role Based Security in ASP.Net: I have a few questions about role based security in an ASP.Net application. Below are some points about our system: - We have a hierarchical roles system stored in a database. - We are also using Windows for authentication. - Page - Role relationships are also held in a database. - We have created a shared assembly for ease of use in applications.
8
4892
by: Mark White | last post by:
Hey everyone I'm having a great deal of problems finding this information through google and yahoo, so I turn to you on this. I have a Windows app running on XP. I am able to caputre the user's Name property in the WindowsPrincipal's IIdentity interface. Where can I find the role that the user is assigned for the current login? I only want the one role which is assigned for the current user, not all of
7
3001
by: nugget | last post by:
Role-based security for an ASP/ASP.NET mixed environment Hello: My co-worker and I have been charged with designing role-based security for our intranet. The technologies we have to work with are ASP and ASP.NET. This security design must support *both* technologies. Currently, we have a successful collection of both ASP and ASP.NET applications with an identical look and feel; you'd only know they are different by virtue of an ASP...
6
18654
by: Max2006 | last post by:
Hi, I need to hide a series of siteMapNodes to certain roles. That means roles have access to the siteMapNode, but the node doesn't appear on the navigation menu. I'll use Response.Redirect to jump to hidden pages. How can I do that? I tried securityTrimmingEnabled="true" in my web.config. But it doesn't help because the pages are accessible to the roles. I just want to hide the pages from the main menu when certain roles login
0
8375
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8290
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
8482
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8593
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7306
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6161
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4149
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4294
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1593
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.