Home > Ask the AS/400 Experts > iSeries Application Development Questions & Answers > Retrieving permissions for all objects in our IFS
Ask The iSeries 400 Expert: Questions & Answers
EMAIL THIS

Retrieving permissions for all objects in our IFS

John Blenkinsop EXPERT RESPONSE FROM: John Blenkinsop

Pose a Question
Other iSeries 400 Categories
Meet all iSeries 400 Experts
Become an Expert for this site


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


>
QUESTION POSED ON: 29 September 2004
I'm looking for a way to retrieve the permissions for all of the objects in our IFS and place them in a DB2 file that I can use to manage them. I have been playing with the Qp0lGetAttr() API with an attribute type of 11, but I am struggling on manipulating the array that gets returned in the buffer. I haven't addressed how to do this for more than one object at a time. I would appreciate any help you could provide.

>
Have you seen the API description at IBM's website?

This describes the API and how to use it:

NOTE: I am working in RPGLE. If you are working in C or some other language, you will have to translate some of what I say into your own terms.

The array returned in the buffer pointed to by the buffer_ptr parameter that you give to the API is an array of users with authorities to the object. You can create a User Space object (auto-extending) to hold the information, and give the API the address of the start of the space -- that way you can 'slide' a structure over the User Space by applying offsets to the start address.

Now when the API is executed, it fills the User Space whose address you passed in Buffer_ptr. Read the first 64 bytes into your Qp0l_Authority_General_t structure. The array of users starts at the User Space address plus the offset specified.

Now, for each user in turn, base a structure on the User Space address + offset + (48 * (user entry number - 1))

The structure will be Qp0l_Authority_Users_t as described in the API documentation. Now you can just read the fields in the structure. Here's the the source for a set of User Space procedures we use that can help, and which include list handling of the sort that is involved here.

For the second question, you need to use a list API or QShell command to list the objects in the IFS directories you want to examine. Read that list, and for each object you are interested in call your authority reporting routine. Note that once the User Space has been created, it can be reused just by passing its start address to each call of the API.

==================================
MORE INFORMATION ON THIS TOPIC
==================================

The Best Web Links: tips, tutorials and more.

Ask your programming questions--or help out your peers by answering them--in our live discussion forums.

Ask the Experts yourself: Our application development gurus are waiting to answer your programming questions.


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   



RELATED CONTENT
iSeries Application Development
Monitoring escape messages and using RCVMSG for diagnostic messages
Listing contents of multiple FTP directories on AS/400
Chain operation error after converting RPG3 to ILE RPG (RPGIV)
Space offset X'0015FF00' or X'0000000000000000' is outside current limit for object QIGC2424C
Searching fields for values
iSeries application display subfiles with other program windows
Searching part of a name or address in AS/400
Passing parameters in an ILE RPG module
What's happening to my subfile?
What happening to my subfile?

RPG iSeries programming
Enhancing RPG with external SQL stored procedures
Introduction to SQLRPGLE on IBM i: Making a report
Making the most of RPG data handling on IBM i
IBM i shop boosts online sales with RPG-based Web platform
Migrating from RPG to EGL on IBM i
Allow access to data from a stored procedure result set using COBOL or RPG
EGL Rich UI on IBM i: Do you Dojo?
Programming for the Web on the IBM i, what is possible
A taste of COMMON: ILE, IBM releases, Web applications and new products
Documenting nested program structures on the AS/400

iSeries ILE programming
Tracking data changes on IBM i with triggers
Introduction to SQLRPGLE on IBM i: Making a report
How to use an embedded SQL statement and display the result in a subfile
Eight steps for creating program documentation using AS/400 utilities
Searching fields for values
Searching part of a name or address in AS/400
Top 10 programmer tips YTD
How to use the binder language to manage service programs -- Part 3: Examples and pitfalls
Top 10 programmer tips of 2005
How to use the binder language to manage service programs -- Part 2: Understanding the binder language

RELATED GLOSSARY TERMS
Terms from Whatis.com − the technology online dictionary
Report Program Generator  (Search400.com)

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary



Search and Browse the Expert Answer Center
Search and browse more than 25,000 question and answer pairs from more than 250 TechTarget industry experts.
Browse our Expert Advice



iSeries Networking - Printing, Remote Access, TCP/IP
HomeNewsTopicsITKnowledge ExchangeTipsBlogsAsk the ExpertsMultimediaWhite PapersProducts
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 1999 - 2009, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts