Solved

File previlages for the current logged user

Posted on 2004-09-14
2
206 Views
Last Modified: 2013-11-20
I have created a database file in Administrator mode  under windows XP operating system  using vc++ application. When I login as a Guest and try to open the same file using my VC++ application it fails.
Please suggest me how do I know the current user permission for a file using MFC coding .
0
Comment
Question by:shrinivasbk
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
2 Comments
 
LVL 13

Accepted Solution

by:
SteH earned 100 total points
ID: 12052710
Do you want to read the exact file permissions or do you just want to know if privileges unable the current user to open that file?
For latter you can supply a CFileException as last parameter in CFile::Open. In case of a failure to open this exception var will be filled and you can check its m_cause member. If it equals CFileException::accessDenied you don't have enough priviliges.

If you want the full access priviliges of that file you need to run a program as administrator and check/read its permissions. This only makes little sense in the context you asked so I don't go into detail here.
0
 
LVL 13

Expert Comment

by:SteH
ID: 12062645
Hi shrinivasbk,

it would be nice to get a second chance before receiving a grade of C. You question was not very detailed so a detailed answer could not be expected in the first go. Experts are willing to give more detailed anwers if needed but you need to allow tem to.

You might want to read the help on grading at
http://www.experts-exchange.com/help.jsp#hi73
<snip>
# C: Because Experts' reliability are often judged by their grading records, many Experts would like the opportunity to clarify if you have questions about their solutions. If you have given the Expert(s) ample time to respond to your clarification posts and you have responded to each of their posts providing requested information; or if the answers, after clarification, lack finality or do not completely address the issue presented, then a "C" grade is an option. You also have the option here of just asking Community Support to delete the question.
<snip>

0

Featured Post

[Live Webinar] The Cloud Skills Gap

As Cloud technologies come of age, business leaders grapple with the impact it has on their team's skills and the gap associated with the use of a cloud platform.

Join experts from 451 Research and Concerto Cloud Services on July 27th where we will examine fact and fiction.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

617 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question