Security Role for current item

J

John Carlier

On a custom Appointment/Meeting item I have created a new page (p.2)
on which sensitive information can be posted. The meeting request is
then mailed as normal. Once this item has been saved to the calendar
we wish only users with a certain role (Editor) and above to be able
to see the extra page.

My first problem with this is how can I read the role of the current
user in the Item_open event on the form?

Exchange 2003/Outlook 2003 environment.
 
S

Sue Mosher [MVP-Outlook]

Role as defined where? Is this form being used in a public folder?
 
G

Guest

No. The Calendar folder of the user.

Sue Mosher said:
Role as defined where? Is this form being used in a public folder?

--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
G

Guest

To clarify: What I want is in fact what happens in Outlook when you right
click a folder, choose properties and then permissions. I would like this
information in a format that I can use to compare with the current user. I
did not think this up but do have to implement it.

Do I have to do this via ADSI or something else?
If so what?
Will I have to distribute dll's?

John.
 
S

Sue Mosher [MVP-Outlook]

The current user always has full rights to all folders in their own mailbox.

--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers



John C said:
To clarify: What I want is in fact what happens in Outlook when you right
click a folder, choose properties and then permissions. I would like this
information in a format that I can use to compare with the current user. I
did not think this up but do have to implement it.

Do I have to do this via ADSI or something else?
If so what?
Will I have to distribute dll's?
 
G

Guest

Sorry I should have said it is the case where they are looking at the
calendar of someone else. This company wants everyone to have read access to
everyones agenda. However only "Editor" may see the extra page.

I today found the ACL.DLL from Exchange 5.5 that seems to be what I am
looking for. Has anyone used this with Outlook/Exchange 2003?

Is there any easier way to do this?
 
G

Guest

Thanks for the tip. However I am still having a problem with this.
- I have added the following code to the item_open on my appointment form.
- Published the form in the Organizational form libray
- Created an item using the form in my calendar.
- Given a user write access to my calendar
- Logged in as that user and tried to read my item

The code in the form is executed but I do not get a value in the objCDOItem.
In other words objCDOSession.GetFolder(....) does not seem to be working.

Function Item_Open()
Dim oInsp
on error resume next
set oInsp = Item.GetInspector
if (Item.Size > 0) then
IsAuthor = false
set objCDOSession = CreateObject("Mapi.Session")
objCDOSession.Logon,,False,False
set objCDOItem =
objCDOSession.GetFolder(item.Parent.EntryID,Item.Parent.StoreID)
CdoPR_ACCESS = &H0FF40003
strFolderAccess = objCDOItem.Fields(CdoPR_ACCESS)

MAPI_ACCESS_MODIFY = strFolderAccess AND &H00000001

If MAPI_ACCESS_MODIFY <> 0 Then
IsAuthor = true
End If
if IsAuthor <> true then
oInsp.HideFormPage("Gevoelig")
set oInsp = nothing
else
oInsp = oInsp.ShowFormPage("Gevoelig")
end if
else
oInsp = oInsp.ShowFormPage("Gevoelig")
end if
End Function
 
S

Sue Mosher [MVP-Outlook]

Outlook 2003 and Outlook 2002 SP3 include a new setting -- turned off by
default -- to allow forms in shared mailboxes to run script. You can change
the setting in Outlook 2003 by choosing Tools | Options | Other | Advanced
Options and checking the box for "Allow script in shared folders." See
http://www.slipstick.com/dev/ol2003problems.htm#mailboxscript for more
information on this setting and the comparable setting (on by default) for
forms in public folders.
 
G

Guest

Sue,

I have already set that setting.

The code works when I look at my own calendar.

The problem is that when I try to look at the calendar folder of someone
else. The objSession.GetFolder( ...) does not return a value. However I can
open the item!!! and the form displays the item.
 
S

Sue Mosher [MVP-Outlook]

GetFolder() works only with folders visible in the Folder List. Did you add
the other mailbox as a secondary mailbox? If not, GetFolder() can't access
it.
--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
G

Guest

No I have not done that.

I have only used the "Open a Shared Calendar" to access the other calendar.

Does this mean that I can not use the CDO GetFolder(FolderId,StoreId)?

Can I add someones Calendar folder to this "Folder List" on the fly? i.e. in
the Item_Open code?
 
S

Sue Mosher [MVP-Outlook]

I have only used the "Open a Shared Calendar" to access the other
calendar.
Does this mean that I can not use the CDO GetFolder(FolderId,StoreId)?
Correct.

Can I add someones Calendar folder to this "Folder List" on the fly? i.e.
in
the Item_Open code?

No. It has to be done through the Exchange account properties.

--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
G

Guest

Then your comment

is not going to solve my problem.

By this site the plan is to give everyone read access to eveyones
agenda....i.e. it will not be via exchange account properties.

Is there no wat to read this information from any folder?
 
S

Sue Mosher [MVP-Outlook]

The code sample suggested shows how to use CDO 1.21 to read Exchange folder
permissions. Isn't that what you're asking how to do?

--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
G

Guest

Yes that is true. But if you can not get a link to the folder...

As I stated in one of my replies we want to be able to read the permissions
on the calendar folder from any user.

What I don't understand is how Outlook does this. If I right-click etc on
the calendar I am accessing via "Open a Shared Calendar" I get to see all
the permission information.

I have used getFolder in the past and did not realise there was this
restriction on it.
I still dont understand why as you have all the unique information, entryid
and storeId, which gave me the impression it would work.

Any other ideas?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top