Re: Check Permissions

From: AvalonDave (AvalonDave_at_discussions.microsoft.com)
Date: 07/22/04


Date: Thu, 22 Jul 2004 07:12:02 -0700

Anyone have any suggestions?

"Rick B" wrote:

> Ahhhh. That might be a bit easier. I don't know how to do it, but I'm
> certian someone who does will get back to you.
>
> Rick B
>
>
> "AvalonDave" <AvalonDave@discussions.microsoft.com> wrote in message
> news:9B1A49E4-16EE-4244-A22A-6937AAAD9A4C@microsoft.com...
> Thanks Rick, but I beleive you are misunderstanding my question.
>
> What I want to do is be able to do is reference the current user logged onto
> the database. From there, I would like to check if they have been given
> permission to access a specific form. If they are NOT allowed to access
> this, I would like to give them a customized error message.
>
> "Rick B" wrote:
>
> > Access will do this, but at the object level.
> >
> > You can't tell Access that a particular page of a switchboard is alloed
> for
> > some, but not others.
> >
> > If you create your own switchboards by making forms with buttons, then you
> > could allow or not allow access to the particular forms.
> >
> > In short, the swichboard does not have anything to do with security, it is
> > the actual object.
> >
> > That being said, you could write the code you mention, but with the
> dynamic
> > nature of switchboards it would be very hard to construct the "if"
> statement
> > to know which "button" they were cliecking, since the buttons are dynamic.
> >
> > Also, what if it changes? The whole point of creating groups and users
> was
> > to make the permissions easy to maintain and uniform. Now you will have
> to
> > also change vba code if permissions change. Yuck!
> >
> > Personally, I don't use the built-in switchboard because of these types of
> > limitations.
> >
> >
> > Rick B
> >
> >
> >
> > "AvalonDave" <AvalonDave@discussions.microsoft.com> wrote in message
> > news:CD9960B8-2C58-4924-A094-331B1A0926F0@microsoft.com...
> > Hi-
> >
> > I have set up a security class for my DB using the security wizard.
> >
> > I have a large list of users and groups with different permission levels.
> >
> > What I want to do is be able to manipulate my switchboard according to
> > someone's permissions.
> >
> > For example, I would like for someone that has the permission to view the
> > financial data to be able to click a button on the switchboard that links
> to
> > the financial data form, however if they do not have the permissions I
> would
> > like to throw a msgbox at them.
> >
> > Basically what i am asking how would I write this pseudocode in VB:
> >
> > If (currentuser does NOT have permissions to view THIS OBJECT) Then
> > msgbox("You do not have permission")
> > cancel action
> > End if
> >
> >
> > Thanks guys!
> >
> >
> >
>
>
>