- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi, all,
I am wondering how to write a module with different access control. For example, module A and B use module C. I want some entries in C can be accessed by A, but not B. And I hope I needn't to write only list explicitly in B.
Cheers,
DONG Li
I am wondering how to write a module with different access control. For example, module A and B use module C. I want some entries in C can be accessed by A, but not B. And I hope I needn't to write only list explicitly in B.
Cheers,
DONG Li
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Although what you want is not directly possible (for obvious reasons: an item is either public or private, subject to the additional requirements imposed by host association; you cannot have have something private for B but public for A), you can achieve the desired results in a few ways.
1. If the entries to be made unavailable to B are few, you can declare in module B:
use C, except1 => C1, except2 => C2, ...
and remember not to use 'except1' and 'except2' anywhere else in module B.
2. You can create a modules CB which declares USE C and, in addition, declares as PRIVATE those items to which you wish to prohibit access from C. Then, in module B, use USE CB instead of USE C
1. If the entries to be made unavailable to B are few, you can declare in module B:
use C, except1 => C1, except2 => C2, ...
and remember not to use 'except1' and 'except2' anywhere else in module B.
2. You can create a modules CB which declares USE C and, in addition, declares as PRIVATE those items to which you wish to prohibit access from C. Then, in module B, use USE CB instead of USE C
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page