Showing posts with label roles. Show all posts
Showing posts with label roles. Show all posts

Monday, March 26, 2012

membership, roles and login controls with sql server 2000

hello, I have developed a website using asp.net 2.0 and sql server 2005 express edition. I have used the built-in membership, roles and login controls in my website. now i need to change the database server. i have to use sql server 2000 instead. as asp.net 2.0 uses the ASPNETDB.mdf for member,roles and login controls, so how can i do it? i can easily export the database from 2005 to 2000 but how my application controls will know where to look at for those data. I am clueless. please help me.

thanks in advance.

See if this link at ASPNet101.com helps:

http://aspnet101.com/aspnet101/tutorials.aspx?id=63

|||thanks a lot. this is exactly what i was looking forSmile

Membership GetAllUsers SP

Hello,

I am using the Membership application for my project. In the database (MS SQL 2005) the program created alot of SPs for the Membership, Roles, Profiles ...

Is there a function to return a list of users that are online? There is this functionaspnet_Membership_GetNumberOfUsersOnline andaspnet_Membership_GetAllUsers.

What i want is a Table with the usernames of all the users that are online in my application. No page index, just a big table with all the online users. I need to get all the usernames for another SP that i just build.

Any ideas?

To my knowledge there is not, but this would be a good one to add to the library. Realize that this would be a method that would be specific to the SQL or Custom Membership provider because AD would not be able to support this.

|||

I tried this, but i cant get it to return any rows, even tho atleast 4 people is logged in.

CREATEPROCEDURE [dbo].[aspnet_Membership_GetAllOnlineUsers]
@.ApplicationNamenvarchar(256),
@.MinutesSinceLastInActiveint,
@.CurrentTimeUtcdatetime
AS
BEGIN
DECLARE @.DateActivedatetime
SELECT @.DateActive=DATEADD(minute,-(@.MinutesSinceLastInActive), @.CurrentTimeUtc)

CREATETABLE #PageIndexForUsersNames
(
Usernamenvarchar(20)NOTNULL
)

INSERTINTO #PageIndexForUsersNames(Username)
SELECT u.Username
FROM dbo.aspnet_Users u(NOLOCK),
dbo.aspnet_Applications a(NOLOCK),
dbo.aspnet_Membership m(NOLOCK)
WHERE u.ApplicationId= a.ApplicationIdAND
LastActivityDate> @.DateActiveAND
a.LoweredApplicationName=LOWER(@.ApplicationName)AND
u.UserId= m.UserId
SELECT UsernameFROM #PageIndexForUsersNames
END

And then i tried to run the following:

EXEC aspnet_Membership_GetAllOnlineUsers
@.ApplicationName= N'//',
@.MinutesSinceLastInActive= 10,
@.CurrentTimeUtc='2007-11-15 18:45'

The applicationname did i take from the applications table.

Any ideas?

|||

Sorry that was the old, this is what i am trying:

aspnet_Membership_GetAllOnlineUsers
@.ApplicationNamenvarchar(256),
@.MinutesSinceLastInActiveint,
@.CurrentTimeUtcdatetime
AS
BEGIN
DECLARE @.DateActivedatetime
SELECT @.DateActive=DATEADD(minute,-(@.MinutesSinceLastInActive), @.CurrentTimeUtc)

SELECT u.Username
FROM dbo.aspnet_Users u(NOLOCK),
dbo.aspnet_Applications a(NOLOCK),
dbo.aspnet_Membership m(NOLOCK)
WHERE u.ApplicationId= a.ApplicationIdAND
LastActivityDate> @.DateActiveAND
a.LoweredApplicationName=LOWER(@.ApplicationName)AND
u.UserId= m.UserId
END

|||

You've specified a UTC time that is still in the future.

@.CurrentTimeUtc='2007-11-15 18:45' won't be for another 30 minutes.

|||

To be honest, I'm still not sure why the ASP.NET team decided to do it that way, it seems against best practices to have the client application trying to send in times when the window we're looking for is normally minutes, especially when it's extremely easy to make sure that we always use a single clock for reference:

aspnet_Membership_GetAllOnlineUsers
@.ApplicationNamenvarchar(256),
@.MinutesSinceLastInActiveint

AS
BEGIN
DECLARE @.DateActivedatetime
SELECT @.DateActive=DATEADD(minute,-(@.MinutesSinceLastInActive), GetUtcDate())

SELECT u.Username
FROM dbo.aspnet_Users u(NOLOCK),
dbo.aspnet_Applications a(NOLOCK),
dbo.aspnet_Membership m(NOLOCK)
WHERE u.ApplicationId= a.ApplicationIdAND
LastActivityDate> @.DateActiveAND
a.LoweredApplicationName=LOWER(@.ApplicationName)AND
u.UserId= m.UserId
END

members of db_owner can't mangage roles?

I have two people assigned to the db_owner role in a database and they can do
everything except manage users and roles. For example when they try to look
at the properties of a role in EM they get the following error message:
Error229: EXECUTE permission denied on object ‘sp_helprolemember’, database
‘master’, owner dbo
(The same thing happens in QA)
In master, the public role has permission to execute sp_helprolemember and
both of these users are members of the public role in master.
I also tried adding them to the db_accessadmin and db_securityadmin roles in
the database as well as making them members of the securityadmin server role.
None of this worked either.
Any suggestions?
Did you check for user, roles denied execute on the stored
procedure?
use master
go
sp_helprotect 'sp_helprolemember'
-Sue
On Wed, 27 Apr 2005 14:22:07 -0700, "AlexB_05"
<AlexB_05@.discussions.microsoft.com> wrote:

>I have two people assigned to the db_owner role in a database and they can do
>everything except manage users and roles. For example when they try to look
>at the properties of a role in EM they get the following error message:
>Error229: EXECUTE permission denied on object sp_helprolemember, database
>master, owner dbo
>(The same thing happens in QA)
>In master, the public role has permission to execute sp_helprolemember and
>both of these users are members of the public role in master.
>I also tried adding them to the db_accessadmin and db_securityadmin roles in
>the database as well as making them members of the securityadmin server role.
> None of this worked either.
>Any suggestions?
|||That was it. Somehow the public role did not have permission to execute
sp_helprolemember. Once I granted those permissions everything worked.
"Sue Hoegemeier" wrote:

> Did you check for user, roles denied execute on the stored
> procedure?
> use master
> go
> sp_helprotect 'sp_helprolemember'
> -Sue
> On Wed, 27 Apr 2005 14:22:07 -0700, "AlexB_05"
> <AlexB_05@.discussions.microsoft.com> wrote:
>
>

members of db_owner can't mangage roles?

I have two people assigned to the db_owner role in a database and they can do
everything except manage users and roles. For example when they try to look
at the properties of a role in EM they get the following error message:
Error229: EXECUTE permission denied on object â'sp_helprolememberâ', database
â'masterâ', owner dbo
(The same thing happens in QA)
In master, the public role has permission to execute sp_helprolemember and
both of these users are members of the public role in master.
I also tried adding them to the db_accessadmin and db_securityadmin roles in
the database as well as making them members of the securityadmin server role.
None of this worked either.
Any suggestions?Did you check for user, roles denied execute on the stored
procedure?
use master
go
sp_helprotect 'sp_helprolemember'
-Sue
On Wed, 27 Apr 2005 14:22:07 -0700, "AlexB_05"
<AlexB_05@.discussions.microsoft.com> wrote:
>I have two people assigned to the db_owner role in a database and they can do
>everything except manage users and roles. For example when they try to look
>at the properties of a role in EM they get the following error message:
>Error229: EXECUTE permission denied on object ?sp_helprolemember?, database
>?master?, owner dbo
>(The same thing happens in QA)
>In master, the public role has permission to execute sp_helprolemember and
>both of these users are members of the public role in master.
>I also tried adding them to the db_accessadmin and db_securityadmin roles in
>the database as well as making them members of the securityadmin server role.
> None of this worked either.
>Any suggestions?|||That was it. Somehow the public role did not have permission to execute
sp_helprolemember. Once I granted those permissions everything worked.
"Sue Hoegemeier" wrote:
> Did you check for user, roles denied execute on the stored
> procedure?
> use master
> go
> sp_helprotect 'sp_helprolemember'
> -Sue
> On Wed, 27 Apr 2005 14:22:07 -0700, "AlexB_05"
> <AlexB_05@.discussions.microsoft.com> wrote:
> >I have two people assigned to the db_owner role in a database and they can do
> >everything except manage users and roles. For example when they try to look
> >at the properties of a role in EM they get the following error message:
> >
> >Error229: EXECUTE permission denied on object â'sp_helprolememberâ', database
> >â'masterâ', owner dbo
> >
> >(The same thing happens in QA)
> >
> >In master, the public role has permission to execute sp_helprolemember and
> >both of these users are members of the public role in master.
> >
> >I also tried adding them to the db_accessadmin and db_securityadmin roles in
> >the database as well as making them members of the securityadmin server role.
> > None of this worked either.
> >
> >Any suggestions?
>

members of db_owner can't mangage roles?

I have two people assigned to the db_owner role in a database and they can d
o
everything except manage users and roles. For example when they try to look
at the properties of a role in EM they get the following error message:
Error229: EXECUTE permission denied on object ‘sp_helprolemember’, data
base
‘master’, owner dbo
(The same thing happens in QA)
In master, the public role has permission to execute sp_helprolemember and
both of these users are members of the public role in master.
I also tried adding them to the db_accessadmin and db_securityadmin roles in
the database as well as making them members of the securityadmin server role
.
None of this worked either.
Any suggestions?Did you check for user, roles denied execute on the stored
procedure?
use master
go
sp_helprotect 'sp_helprolemember'
-Sue
On Wed, 27 Apr 2005 14:22:07 -0700, "AlexB_05"
<AlexB_05@.discussions.microsoft.com> wrote:

>I have two people assigned to the db_owner role in a database and they can
do
>everything except manage users and roles. For example when they try to loo
k
>at the properties of a role in EM they get the following error message:
>Error229: EXECUTE permission denied on object sp_helprolemember, databas
e
>master, owner dbo
>(The same thing happens in QA)
>In master, the public role has permission to execute sp_helprolemember and
>both of these users are members of the public role in master.
>I also tried adding them to the db_accessadmin and db_securityadmin roles i
n
>the database as well as making them members of the securityadmin server rol
e.
> None of this worked either.
>Any suggestions?|||That was it. Somehow the public role did not have permission to execute
sp_helprolemember. Once I granted those permissions everything worked.
"Sue Hoegemeier" wrote:

> Did you check for user, roles denied execute on the stored
> procedure?
> use master
> go
> sp_helprotect 'sp_helprolemember'
> -Sue
> On Wed, 27 Apr 2005 14:22:07 -0700, "AlexB_05"
> <AlexB_05@.discussions.microsoft.com> wrote:
>
>sql

Member security question

Hello!
In our AS2005 project we use two roles for two different group of users. First group included key account manager - each manager can see only his account sales. Second group - sales region managers - each sales region manager can see only sales in his region. We use custom clr callback method and everything works fine. Solution is based on dimension members and visual totals are enabled for both groups.

But now new requirement arrived: one manager is both key account AND sales region at the same time and therefore he should be able to see UNION of key account sales and region sales. Can this be accomplished somehow? I'm able to get the intersection, but never union. One solution is to turn visual totals off, but then other dimensions show all cube data, which is not acceptable.

Any help is appreciated.

Radim

I think you will need a third role for this person.

Basically I am guessing that your account security produces a set that looks something like:

Descendants([Account].[Account].[Account 1])

And that your Region security produces a set that looks something like:

Descendants([Region].[Region].[Region1])

This will result for an effective permission set of:

Descendants([Account].[Account].[Account 1]) * Descendants([Region].[Region].[Region1])

Which is effectively an intersection of the selected account with the selected region. Whereas, for the situation you describe, you would want an effective final set of:

{ {[Region].[Region].[All Region]} * Descendants([Account].[Account].[Account 1]) }

* { Descendants([Region].[Region].[Region1]) * { [Account].[Account].[All Account] } }

Which, instead of giving you a logical AND between the two sets (where members must be descendants of the Regions AND Account) will give you a logical OR (which will return members which are descendants of either the Account OR Region)

Hope this helps

|||Hi Darren!
That's good description of desired solution. But how could I implement such set? Right now callback function simply returns allowed members to role, but this solution doesn't seem to be that straitforward. New role should restrict cell data, instead of dimension members?

Radim|||

Hi Radim,

Since these users (given their dual role) should be able to see all members of both Account and Region, I think that the solution would have to restrict at the cell, rather than dimension, level. However, I'm not aware of a "Visual Totals" option for Cell Security, which is one of your requirements. Visual Totals behavior could conceivably be simulated via the MDX script, if that's a viable option for you. But this would entail introducing security-related logic into the cube script.

sql