web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Orphan records in the SecurableObject table

(0) ShareShare
ReportReport
Posted on by 6,194

I'm working on fixing a bug in an EG security tool that we sell. 

The feature I'm looking into is dependant on the SecurableObject table and I have found that it contains some orphan records. It looks like renaming a securable object, like a menu item, doesn't always get reflected in the table. I have a record for both the new and the old name. Renaming has been done under TFS versions kontrol.

I'm of course not able to repro the scenario.

Does anyone have an insight as to why the tables ends up with these orphans, or do you know of any existing way to clean it up?

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Sohaib Cheema Profile Picture
    49,438 User Group Leader on at

    Hi Palle,

    Your observation is correct.

    I believe reason for orphan objects in this table/view is because records are never deleted. Instead every time you rename an object it creates a record irrespective of whether old object does exist or not.

    As an experiment you can do following

    Create a dummy table and save it. Now drag this table into a new privilege and run following query

     

    select * from SecurableObject

    where Name Like '%DummyTable%'

     

     

    Further, rename DummayTable to something else let’s say DummayTableNewName

    Now re-add this table DummayTableNewName into privilege , which we created earlier. Now Rerun the above query

     

    You will find two records in table/view SecurableObject

  • PA-22040759-0 Profile Picture
    6,194 on at

    Excellent Sohaib.

    Just the repro I needed.

    I see that the the "orphan" records gets a recVersion of -1. I wonder if I can trust that is always the case.

    Thank you.

  • Sohaib Cheema Profile Picture
    49,438 User Group Leader on at

    Hi Palle,


    Unfortunately I cannot trust -1(RecVersion) as of now. Because as per my testing its -1 for new record as well as for orphan record.

    .
    As of now I can say that, because origin of SecurableObject(view) is ModelSecurityCommon(view), so We can do something e.g. to join SecurableObject with model information to know what elements really exist as of now. Thus we can skip non-existing elements from SecurableObject

    .


    I will spend some more time to explore it, later by this weekend.

    In addition, I am not sure about working of your security tool/product i.e. (EG), if I do have some idea what the product EG is doing with SecurableObject, might be I can contribute somewhat more effectively.

  • Suggested answer
    Vilmos Kintera Profile Picture
    46,149 on at

    SecurableObjects is a SQL view on ModelSecurityCommon table within the model database.

    You could correlate ModelSecurityCommon with ModelElement by name to see what is missing.

    SELECT * FROM [dbo].[ModelSecurityCommon] AS Security
    WHERE NOT (EXISTS(
    	SELECT 'x' FROM [dbo].[ModelElement] AS Element
    		WHERE Security.NAME = Element.Name
    	))
    

    This should give a list of securable objects which no longer have a match with any AOT elements.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans